* Set current directory and open log
cd "E:\Seagate Sync\VOL\Personal folder\Documents\Research\Current projects\Working party meetings\Posted\EUP 160404"
capture log close
log using "Data management\wpar-management05-workingparties02-code", replace text


********************************************************************************************
* Coding of working party meetings and generation of individual-level and aggregate datasets
********************************************************************************************


* Project and author information
********************************
* Programme:	wpar-management05-workingparties02-code.do
* Date:			4 April 2016
* Author:		Frank Haege, University of Limerick
* Contact:		frank.haege@ul.ie 

* Do-file description
*********************
* This do-file codes working party meetings by working party name. In cases where two or more
* working parties have a very similar name at different points in time, the only way to 
* distinguish between them is by cross-referencing meeting dates with the dates of operation
* of the working parties from the List of Council Preparatory Bodies documents. This is done in 
* the next script. In general, the coding procedure ascribes a code based on particular words
* in the title. Rather than specifying all possible exceptions in the 'if' condition, the procedure
* corrects the coding of individual working parties post hoc if manual inspection suggests that
* they have been assigned the incorrect code.
* In general, earlier code assignments are not overwritten by later ones. Thus, subgroups are 
* coded before the working party they belong to (the text of the working party title
* also appears in the title of the sub-group, but because the sub-groups have already been coded,
* their codes are not overwritten). 
* Usually, several regular expressions have been tried as search terms to ensure maximal recall
* at the expense of precision (and manual corrections applied post hoc in case of false positives).
* Working parties for which no meetings can be identified are recorded manually
* in a separate CSV file (wpar-management05-workingparties02-code-nomeets.csv)
* to double-check completeness of merge with working party meeting data.


* Clear memory  
**************
version 12.0
clear all
macro drop _all
set more off

* Load dataset
use "Data management\wpar-management04-workingparties01-clean", clear
des, s


**********************************
* Coding of working party meetings
**********************************

* Treaty Committees
*******************

* Coreper 1
replace wpcode = "A01a" if wpcode == "" /*
	*/ & index(wpname, "COREPER 1") > 0
* Coreper meetings are recorded in separate file
*groups wpname if regexm(wpcode, "A01a"), order(h) miss
replace wpcode = "Z00" if wpcode == "A01a"
* 3 observations dropped


* Coreper 2
replace wpcode = "A01b" if wpcode == "" /*
	*/ & index(wpname, "COREPER 2") > 0
* Coreper meetings are recorded in separate file
*groups wpname if regexm(wpcode, "A01b"), order(h) miss
replace wpcode = "Z00" if wpcode == "A01b"
* 3 observations dropped	


* Economic and Financial Committee
replace wpcode = "A02" if wpcode == "" /*
	*/ & index(wpname, "COMITE ECONOMIQUE ET FINANCIER") > 0
**groups wpname if regexm(wpcode, "A02"), order(h) miss
* Administrative support by Commission, probably meets in Commission building
	
	
* Employment Committee
* Predecssor: COMITE SUR L'EMPLOI ET MARCHE DU TRAVAIL (C.E.M.T.)
*groups wpname if wpcode == "" /*
	*/ & (index(wpname, "COMITE DE L'EMPLOI") > 0 /*
	*/ | regexm(wpname, "MARCHE.*TRAV") > 0)
replace wpcode = "A03" if wpcode == "" /*
	*/ & (index(wpname, "COMITE DE L'EMPLOI") > 0 /*
	*/ | regexm(wpname, "MARCHE.*TRAV") > 0)
*groups wpname if regexm(wpcode, "A03"), order(h) miss
* Administrative support by Commission, probably meets in Commission building
replace wpcode = "Z00" if wpcode == "A03"
* Drop the two meetings in Brdo, as well as the 11 meetings of predecessor committee (pre-1999)


* Article 133 Committee: Full Members
replace wpcode = "A04a" if wpcode == "" /*
	*/ & (index(wpname, "133 TITULAIRES") > 0 /*
	*/ | index(wpname, "COMITE DE LA POLITIQUE COMMERCIALE (TITULAIRES)") > 0)
*groups wpname if regexm(wpcode, "A04a"), order(h) miss


* Article 133 Committee: Deputies
replace wpcode = "A04b" if wpcode == "" /*
	*/ & (index(wpname, "133 SUPPLEANTS") > 0 /*
	*/ | index(wpname, "COMITE DE LA POLITIQUE COMERCIALE (SUPPLEANTS)") > 0 /*
	*/ | index(wpname, "COMITE DE LA POLITIQUE COMMERCIALE (SUPPLEANTS)") > 0 /*
	*/ | index(wpname, "113 SUPPLEANTS") > 0 /*
	*/ | index(wpname, "COMITE POL. COMMERCIALE (SUPPL.)") > 0)
*groups wpname if regexm(wpcode, "A04b"), order(h) miss


* Article 133 Committee (Experts): Textiles
replace wpcode = "A04c" if wpcode == "" /*
	*/ & (index(wpname, "133 TEXTILES") > 0 /*	
	*/ | index(wpname, "CONSEILLERS / ATTACHES 133 / TEXTILES") > 0 /*
	*/ | index(wpname, "113 TEXTILES") > 0)
*groups wpname if regexm(wpcode, "A04c"), order(h) miss


* Article 133 Committee (Experts): Services
replace wpcode = "A04d" if wpcode == "" /*
	*/ & (index(wpname, "133 SERVICES") > 0 /*
	*/ | index(wpname, "ARTICLE 133 (SERVICES)") > 0 /*	
	*/ | index(wpname, "ARTICLE 133 - SERVICES") > 0 /*		
	*/ | index(wpname, "ARTICLE 133 SERVICES") > 0 /*	
	*/ | index(wpname, "113 SERVICES") > 0)
*groups wpname if regexm(wpcode, "A04d"), order(h) miss


* Article 133 Committee (Experts): Steel
replace wpcode = "A04e" if wpcode == "" /*
	*/ & (index(wpname, "133 ACIER") > 0 /*
	*/ | index(wpname, "113 CECA") > 0 /*
	*/ | index(wpname, "113 / CECA") > 0 /*
	*/ | index(wpname, "133 CECA") > 0)					/* CECA stands for European Coal and Steel Community */
*groups wpname if regexm(wpcode, "A04e"), order(h) miss


* Article 133 Committee (Experts): Motor Vehicles
replace wpcode = "A04f" if wpcode == "" /*
	*/ & (regexm(wpname, "113.+VEH") /*
	*/ | regexm(wpname, "133.+VEH"))
*groups wpname if regexm(wpcode, "A04f"), order(h) miss


* Article 133 Committee (Experts): Mutual Recognition
replace wpcode = "A04g" if wpcode == "" /*
	*/ & (index(wpname, "133 RECONNAISSANCE MUTUELLE") > 0 /*
	*/ | index(wpname, "113 RECONNAISSANCE MUTUELLE") > 0)
*groups wpname if regexm(wpcode, "A04g"), order(h) miss
	
	
* Article 133 Committee (Experts): Steel, Textiles, and other Industrial Sectors (STIS)
replace wpcode = "A04h" if wpcode == "" /*
	*/ & (index(wpname, "133 ATSI") > 0 /*
	*/ | index(wpname, "COMITE DE LA POLITIQUE COMMERCIALE (ATSI)") > 0)
*groups wpname if regexm(wpcode, "A04h"), order(h) miss


* Trade Policy Committee (Services and Investment)	
replace wpcode = "A04i" if wpcode == "" /*
	*/ & (index(wpname, "COMITE DE LA POLITIQUE COMMERCIALE (SERVICES ET INVEST") > 0 /*
	*/ | index(wpname, "COMITE DE LA POLITIQUE COMMERCIALE (SERVICES)") > 0 /*
	*/ | index(wpname, "COMITE POL. COMMERCIALE (SERVICES)") > 0)
*groups wpname if regexm(wpcode, "A04i"), order(h) miss


* Attaches and other Article 133 meetings that cannot be linked to a particular sub-group
replace wpcode = "A04" if wpcode == "" /*
	*/ & (index(wpname, "ATTACHES ARTICLE 133") > 0 /*
	*/ | regexm(wpname, "CONSEILLERS COMMERCIAUX") > 0 /*
	*/ | regexm(wpname, "\+ COMITE 133$") > 0)
replace wpcode = "A04" if wpcode == "" /*
	*/ & index(wpname, "113 ILES FAROE") > 0
*groups wpname if wpcode == "A04", order(h) miss
* Existed only before 2000	


* Political and Security Committee
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COPS)|(COMITE POLIT)|(PSC)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "A05" if wpcode == "" /*
	*/ & regex(wpname, "(COPS)|(COMITE POLIT)|(PSC)")
*groups wpname if wpcode == "A05", order(h) miss

**groups wpname if wpcode != "A05" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COPS)|(COMITE POLIT)|(PSC)") /*
	*/ , order(h) show(freq Freq)

* Make correction
replace wpcode = "" if wpname == "COMITE MILITAIRE (apr�s COPS)"
replace wpcode = "" if regexm(wpname, "COMITE POLITIQUE ECONOMIQUE")
replace wpcode = "" if wpcode == "A05" & regexm(wpname, "INTERIM")
replace wpcode = "" if wpname == "CONJOINT COMITE POL. ET SECURITE / COASI"


* Article 36 Committee
replace wpcode = "A06" if wpcode == "" /*
	*/ & (index(wpname, "ARTICLE 36") > 0 /*
	*/ | index(wpname, "COMITE K.4") > 0 /* 
	*/ | wpname == "CATS" /*
	*/ | index(wpname, "CATS /") > 0 /*
	*/ | index(wpname, "CATS -") > 0 /*
	*/ | index(wpname, "CATS(") > 0 /*
	*/ | regexm(wpname, " CATS$") > 0 /*
	*/ | index(wpname, "CATS (suite)") > 0 /*
	*/ | index(wpname, "CATS-") > 0 /*
	*/ | index(wpname, "CATS (JUSTICE)") > 0)
*groups wpname if wpcode == "A06", order(h) miss


* Special Committee on Agriculture
replace wpcode = "A07" if wpcode == "" /*
	*/ & (index(wpname, "CSA") > 0 /*
	*/ | index(wpname, "C.S.A") > 0)
*groups wpname if wpcode == "A07", order(h) miss
	
	
* Antici Group
replace wpcode = "A08" if wpcode == "" /*
	*/ & (index(wpname, "ANTICI") > 0)
*groups wpname if wpcode == "A08", order(h) miss


* Mertens Group
replace wpcode = "A09" if wpcode == "" /*
	*/ & (index(wpname, "MERTENS") > 0)
*groups wpname if wpcode == "A09", order(h) miss


* Friends of the Presidency Group: Integrated Political Crisis Response Arrangements and Solidarity Clause Implementation (IPCR/SCI)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS") /*
	*/ & regex(wpname, "(IPCR)|(SCI)|(CLAUSE)|(CRISIS)|(CRISE)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "A10a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS") /*
	*/ & regex(wpname, "(IPCR)|(SCI)|(CLAUSE)|(CRISIS)|(CRISE)")
*groups wpname if wpcode == "A10a", order(h) miss

*groups wpname if wpcode != "A10a" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS") /*
	*/ & regex(wpname, "(IPCR)|(SCI)|(CLAUSE)|(CRISIS)|(CRISE)") /*
	*/ , order(h) show(freq Freq)


* Friends of the Presidency Group: Integrated Maritime Policy (IMP)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS") /*
	*/ & regex(wpname, "(IMP[^A-Z])|(INT.* MAR.* POL)|(PMI)|(POL.* MAR.* INT)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "A10b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS") /*
	*/ & regex(wpname, "(IMP[^A-Z])|(INT.* MAR.* POL)|(PMI)|(POL.* MAR.* INT)")
*groups wpname if wpcode == "A10b", order(h) miss

*groups wpname if wpcode != "A10b" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS") /*
	*/ & regex(wpname, "(IMP[^A-Z])|(INT.* MAR.* POL)|(PMI)|(POL.* MAR.* INT)") /*
	*/ , order(h) show(freq Freq)

	
* Friends of the Presidency Group: Cyber Issues
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CYBER") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "A10c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CYBER")
*groups wpname if wpcode == "A10c", order(h) miss

*groups wpname if wpcode != "A10c" & wpcode != "Z00" /*
	*/ & regex(wpname, "CYBER") /*
	*/ , order(h) show(freq Freq)

	
* Friends of the Presidency Group: Macro-Regional Strategies
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS") /*
	*/ & regex(wpname, "(MACRO.*REGIO)|(STRA.* MACRO)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "A10d" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS") /*
	*/ & regex(wpname, "(MACRO.*REGIO)|(STRA.* MACRO)")
*groups wpname if wpcode == "A10d", order(h) miss

*groups wpname if wpcode != "A10d" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS") /*
	*/ & regex(wpname, "(MACRO.*REGIO)|(STRA.* MACRO)") /*
	*/ , order(h) show(freq Freq)


* Friends of the Presidency Group: Application of Article 10 of Protocol 36 to the Treaties (PROAPP)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & ((regex(wpname, "AMIS") /*
	*/ & regex(wpname, "ART.*")) /*
	*/ | regex(wpname, "PROAPP")) /*
	*/ , order(h) show(freq Freq)
replace wpcode = "A10e" if wpcode == "" & wpcode != "Z00" /*
	*/ & ((regex(wpname, "AMIS") /*
	*/ & regex(wpname, "ART.*")) /*
	*/ | regex(wpname, "PROAPP"))
*groups wpname if wpcode == "A10e", order(h) miss

*groups wpname if wpcode != "A10e" & wpcode != "Z00" /*
	*/ & ((regex(wpname, "AMIS") /*
	*/ & regex(wpname, "ART.*")) /*
	*/ | regex(wpname, "PROAPP")) /*
	*/ , order(h) show(freq Freq)


* Counsellors/Attaches
* A11; allocated to different sectors; no observations


* Security Committee: Information Systems Security Office (INFOSEC)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & (index(wpname, "INFOSEC (AUTORITES D'EVALUATION QUALIFIEES, EXPERTS)") > 0 /*
	*/ | index(wpname, "INFOSEC") > 0 /*
	*/ | wpname == "COMITE DE SECURITE - CSCI" /*
	*/ | wpname == "CSC (I)" /*
	*/ | index(wpname, "CSCI SUB-GROUP") > 0 /*
	*/ | regexm(wpname, "INFORMATION ASSURANCE")) /*
	*/ , order(h) show(freq Freq)
replace wpcode = "A12a" if wpcode == "" /*
	*/ & (index(wpname, "INFOSEC (AUTORITES D'EVALUATION QUALIFIEES, EXPERTS)") > 0 /*
	*/ | index(wpname, "INFOSEC") > 0 /*
	*/ | wpname == "COMITE DE SECURITE - CSCI" /*
	*/ | wpname == "CSC (I)" /*
	*/ | index(wpname, "CSCI SUB-GROUP") > 0 /*
	*/ | regexm(wpname, "INFORMATION ASSURANCE"))
*groups wpname if wpcode == "A12a", order(h) miss

*groups wpname if wpcode != "A12a" & wpcode != "Z00" /*
	*/ & (index(wpname, "INFOSEC (AUTORITES D'EVALUATION QUALIFIEES, EXPERTS)") > 0 /*
	*/ | index(wpname, "INFOSEC") > 0 /*
	*/ | wpname == "COMITE DE SECURITE - CSCI" /*
	*/ | wpname == "CSC (I)" /*
	*/ | index(wpname, "CSCI SUB-GROUP") > 0 /*
	*/ | regexm(wpname, "INFORMATION ASSURANCE")) /*
	*/ , order(h) show(freq Freq)
	
	
* Security Committee: Global Navigation Satellite System (GNSS) Experts
* radionavigation par satellite
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & (index(wpname, "GNSS") > 0) /*
	*/ , order(h) show(freq Freq)
replace wpcode = "A12b" if wpcode == "" /*
	*/ & (index(wpname, "GNSS") > 0)	
*groups wpname if wpcode == "A12b", order(h) miss
	
	
* Security Committee: Security Accreditation Panels (SAPs)
* Groupes d'homologation de s�curit�
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(HOMOL)|(SEC.* ACCRED.* BOARD)|(^SAB )|( SAB$)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "A12c" if wpcode == "" /*
	*/ & regexm(wpname, "(HOMOL)|(SEC.* ACCRED.* BOARD)|(^SAB )|( SAB$)")
**groups wpname if wpcode == "A12c", order(h) miss
* No observations

replace wpcode = "A12c" if wpname == "SAB"

* Security Committee: Global Monitoring for Environment and Security (GMES) Data Security Experts
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & (index(wpname, "SECURITE DES DONNES") > 0 /*
	*/ | index(wpname, "GMES") > 0)
replace wpcode = "A12d" if wpcode == "" /*
	*/ & (index(wpname, "SECURITE DES DONNES") > 0 /*
	*/ | index(wpname, "GMES") > 0)
**groups wpname if wpcode == "A12d", order(h) miss
* No observations


* Security Committee
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SECURITE") /*
	*/ , order(h) show(freq Freq)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & (wpname == "COMITE DE SECURITE CONSEIL" /*
	*/ | wpname == "COMITE DE SECURITE" /*
	*/ | wpname == "COMITE DE SECURITE (AD HOC)" /*
	*/ | wpname == "AD HOC COMITE DE SECURITE")
replace wpcode = "A12" if wpcode == "" /*
	*/ & (wpname == "COMITE DE SECURITE CONSEIL" /*
	*/ | wpname == "COMITE DE SECURITE" /*
	*/ | wpname == "COMITE DE SECURITE (AD HOC)" /*
	*/ | wpname == "AD HOC COMITE DE SECURITE")
*groups wpname if wpcode == "A12", order(h) miss


* Financial Services Committee
replace wpcode = "A13" if wpcode == "" /*
	*/ & (index(wpname, "COMITE DES SERVICES FINANCIERS") > 0 /*
	*/ | index(wpname, "ATTACHES SERVICES FINANCIERS - COMITE") > 0 /*
	*/ | index(wpname, "COMITE SERVICES FINANCIERS") > 0 /*
	*/ | index(wpname, "SERVICES FINANCIERS (COMITE STRUCTURE)") > 0)
*groups wpname if wpcode == "A13", order(h) miss
	
	
* Ad hoc Group on Financial Perspective
replace wpcode = "A14" if wpcode == "" /*
	*/ & (index(wpname, "PERSPECTIVES FINANCIERES") > 0)
*groups wpname if wpcode == "A14", order(h) miss


* Standing Committee on Operational Cooperation on Internal Security (COSI)
replace wpcode = "A15" if wpcode == "" /*
	*/ & (regexm(wpname, "COMITE DE SECURITE INTER") /*
	*/ | index(wpname, "COSI") > 0)	
*groups wpname if wpcode == "A15", order(h) miss
* Support group could be a different working party (like Antici or Mertens)

*groups wpname if wpcode != "A15" & wpcode != "Z00" /*
	*/ & (regexm(wpname, "COMITE DE SECURITE INTER") /*
	*/ | index(wpname, "COSI") > 0) /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "A15" if wpcode != "A15" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & (regexm(wpname, "COMITE DE SECURITE INTER") /*
	*/ | index(wpname, "COSI") > 0)

	
* General Affairs
*****************
	
* WP on General Affairs
replace wpcode = "B01" if wpcode == "" /*
	*/ & (index(wpname, "AFFAIRES GENERALES") > 0)
*groups wpname if wpcode == "B01", order(h) miss


* WP on Enlargement
replace wpcode = "B02" if wpcode == "" /*
	*/ & (index(wpname, "ELARGISSEMENT") > 0)
*groups wpname if wpcode == "B02", order(h) miss

* Make correction
replace wpcode = "" if wpcode == "B02" & regexm(wpname, "PAYS NEG")
replace wpcode = "" if wpcode == "B02" & regexm(wpname, "ADHESION")
replace wpcode2 = "B02" if wpcode == "A04b" & regexm(wpname, "ELARGISSEMENT")


* High Level Working Group on Asylum and Migration
replace wpcode = "B03" if wpcode == "" /*
	*/ & (index(wpname, "GROUPE DE HAUT NIVEAU ASILE ET MIGRATION") > 0 /*
	*/ | ((index(wpname, "H.N") > 0 /*
	*/ | index(wpname, "H. N") > 0 /*
	*/ | index(wpname, "HAUT NIVEAU") > 0)/*
	*/ & index(wpname, "ASILE") > 0 /* 
	*/ & index(wpname, "MIGRATION") > 0) /*
	*/ | index(wpname, "H.N. ASILE") > 0 /*
	*/ | index(wpname, "HN ASILE") > 0 /*
	*/ | index(wpname, "Asile et Migration") > 0 /*
	*/ | index(wpname, "H. N. ASILE") > 0)
*groups wpname if wpcode == "B03", order(h) miss

*groups wpname if wpcode != "B03" & wpcode != "Z00" /*
	*/ & (index(wpname, "GROUPE DE HAUT NIVEAU ASILE ET MIGRATION") > 0 /*
	*/ | ((index(wpname, "H.N") > 0 /*
	*/ | index(wpname, "H. N") > 0 /*
	*/ | index(wpname, "HAUT NIVEAU") > 0)/*
	*/ & index(wpname, "ASILE") > 0 /* 
	*/ & index(wpname, "MIGRATION") > 0) /*
	*/ | index(wpname, "H.N. ASILE") > 0 /*
	*/ | index(wpname, "HN ASILE") > 0 /*
	*/ | index(wpname, "Asile et Migration") > 0 /*
	*/ | index(wpname, "H. N. ASILE") > 0) /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "B03" if wpcode != "B03" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & (index(wpname, "GROUPE DE HAUT NIVEAU ASILE ET MIGRATION") > 0 /*
	*/ | ((index(wpname, "H.N") > 0 /*
	*/ | index(wpname, "H. N") > 0 /*
	*/ | index(wpname, "HAUT NIVEAU") > 0)/*
	*/ & index(wpname, "ASILE") > 0 /* 
	*/ & index(wpname, "MIGRATION") > 0) /*
	*/ | index(wpname, "H.N. ASILE") > 0 /*
	*/ | index(wpname, "HN ASILE") > 0 /*
	*/ | index(wpname, "Asile et Migration") > 0 /*
	*/ | index(wpname, "H. N. ASILE") > 0)
	
	
* Horizontal Working Party on Drugs
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(HDG)|(HORIZ.*DROGUE)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "B04" if wpcode == "" /*
	*/ & regex(wpname, "(HDG)|(HORIZ.*DROGUE)")
*groups wpname if wpcode == "B04", order(h) miss

*groups wpname if wpcode != "B04" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(HDG)|(HORIZ.*DROGUE)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "B04" if wpcode != "B04" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(HDG)|(HORIZ.*DROGUE)")
*groups wpname if wpcode2 == "B04", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "B04" & wpcode2 != "B04" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(HDG)|(HORIZ.*DROGUE)") /*
	*/ , order(h) show(freq Freq)
	
* Drop dialogue meetings
replace wpcode = "Z00" if wpcode == "B04" & regexm(wpname, "DIALOGUE ")


* Working Party on Information
replace wpcode = "B05" if wpcode == "" /*
	*/ & (index(wpname, "GROUPE DE L'INFORMATION") > 0 /*
	*/ | index(wpname, "GROUPE INFORMATION") > 0)
*groups wpname if wpcode == "B05", order(h) miss
	
	
* Working Party on Legal Data Processing
replace wpcode = "B06" if wpcode == "" /*
	*/ & (index(wpname, "INFORMATION JURIDIQUE / CELEX ET TRAITEMENT DES DONNEES") > 0 /*
	*/ | index(wpname, "INFORMATIQUE JURIDIQUE") > 0 /*
	*/ | index(wpname, "E - JUSTICE") > 0 /*
	*/ | index(wpname, "GROUPE INFORM. JURIDIQUE") > 0 /*
	*/ | index(wpname, "LEGISLATION EN LIGNE") > 0 /*
	*/ | index(wpname, "INFORM. JURIDIQUE") > 0)
*groups wpname if wpcode == "B06", order(h) miss
	
	
* Working Party on Electronic Communications: SESAME High Level Coordinators Group /
* Coordination Committee for Communication and Information Systems (CIS): Exports
replace wpcode = "B07a" if wpcode == "" /*
	*/ & (index(wpname, "SESAME") > 0)
*groups wpname if wpcode == "B07a", order(h) miss
* Only observations for electronic communications sub-group, no coordination committee sub-group


* Working Party on Electronic Communications / 
* Coordination Committee for Communication and Information Systems (CIS)
*groups wpname if wpcode == "" /*
	*/ & index(wpname, "COMMUNICATIONS ELECTRONIQUES") > 0, order(h) miss
replace wpcode = "B07" if wpcode == "" /*
	*/ & index(wpname, "COMMUNICATIONS ELECTRONIQUES") > 0
*groups wpname if wpcode == "B07", order(h) miss
	
replace wpcode = "B07" if wpcode == "" /*
	*/ & regexm(wpname, "CIS.* SUPERVISION COORDINATION GROUP")
*groups wpname if wpcode == "B27", order(h) miss


* Working Party on Codification of Legislation
replace wpcode = "B08" if wpcode == "" /*
	*/ & (index(wpname, "CODIFICATION") > 0)
*groups wpname if wpcode == "B08", order(h) miss
	
	
* Working Party of Legal/Linguistic Experts
replace wpcode = "B09" if wpcode == "" /*
	*/ & (index(wpname, "JURISTES - LINGUISTES") > 0 /*
	*/ | index(wpname, "JURISTES LINGUISTES") > 0 /*
	*/ | index(wpname, "JURISTES / LINGUISTES") > 0)
*groups wpname if wpcode == "B09", order(h) miss
	
	
* Working Party on the Court of Justice
replace wpcode = "B10" if wpcode == "" /*
	*/ & (index(wpname, "COUR DE JUSTICE") > 0 /*
	*/ & index(wpname, "AMIS") == 0)
*groups wpname if wpcode == "B10", order(h) miss
	
	
* Working Party on European Arms Policy
*groups wpname if wpcode != "Z00" & regexm(wpname, "POL.*EUR.*ARM")
replace wpcode = "B11" if wpcode == "" /*
	*/ & regexm(wpname, "POL.*EUR.*ARM")
*groups wpname if wpcode == "B11", order(h) miss
	
	
* Working Party on Atomic Questions: Ad hoc Working Party on Nuclear Safety
replace wpcode = "B12a" if wpcode == "" /*
	*/ & (index(wpname, "AD HOC SURETE NUCLEAIRE") > 0 /*
	*/ | index(wpname, "SECURITE NUCLEAIRE") > 0 /*
	*/ | index(wpname, "SOUS - GROUPE SURETE NUCLEAIRE") > 0)
*groups wpname if wpcode == "B12a", order(h) miss
	
	
* Working Party on Atomic Questions
replace wpcode = "B12" if wpcode == "" /*
	*/ & (wpname == "QUESTIONS ATOMIQUES" /*
	*/ | wpname == "ATTACHES QUESTIONS ATOMIQUES" /*
	*/ | wpname == "CONJOINTE AD HOC QUESTIONS ATOMIQUES / NON - PROLIFERATION" /*
	*/ | wpname == "QUESTIONS ATOMIQUES / NON - PROLIFERATION" /*
	*/ | wpname == "CONJOINT RECHERCHE / QUESTIONS ATOMIQUES / QUESTIONS ATOMIQUES" /*
	*/ | wpname == "CONJOINT RECHERCHE / QUESTIONS ATOMIQUES ET GROUPE QUESTIONS ATOMIQUES" /*
	*/ | wpname == "GROUPE CONJOINT QUESTIONS ATOMIQUES / EUROPE ORIENTALE + ASIE CENTRALE" /*
	*/ | wpname == "CONJOINT RECHERCHE / QUESTIONS ATOMIQUES ET QUESTIONS ATOMIQUES" /*
	*/ | wpname == "GROUPE CONJOINT RECHERCHE / ATOMIQUES + QUESTIONS ATOMIQUES")
replace wpcode = "B12" if wpcode == "" /*
	*/ & (wpname == "QUESTIONS ATOMIQUES" /*
	*/ | wpname == "GROUPE CONJOINT RECHERCHE / ATOMIQUES / QUESTIONS ATOMIQUES" /*
	*/ | wpname == "GROUPE CONJOINT RECHERCHE / QUESTIONS ATOMIQUES + QUESTIONS ATOMIQUES" /*
	*/ | wpname == "GROUPE QUESTIONS ATOMIQUES / RECHERCHE + CONJOINT RECHERCHE / ATOMIQUES" /*
	*/ | wpname == "Palais d'Egmont grande salle CONJOINT RECHERCHE / QUESTIONS ATOMIQUES + ATOMIQUES" /*
	*/ | wpname == "QUESTIONS ATOMIQUES + CONJOINT RECHERCHE / ATOMIQUES" /*
	*/ | wpname == "GROUPE QUESTIONS ATOMIQUES / RECHERCHE + CONJOINT RECHERCHE / ATOMIQUES" /*
	*/ | wpname == "GROUPE QUESTIONS ATOMIQUES / RECHERCHE + CONJOINT RECHERCHE / ATOMIQUES" /*
	*/ | wpname == "QUESTIONS ATOMIQUES (EXPERTS)")
*groups wpname if wpcode == "B12", order(h) miss


* Working Party on Structural Measures
replace wpcode = "B13" if wpcode == "" /*
	*/ & (index(wpname, "ACTIONS STRUCTURELLES") > 0)
*groups wpname if wpcode == "B13", order(h) miss
	
	
* Working Party on the Outermost Regions
replace wpcode = "B14" if wpcode == "" /*
	*/ & (index(wpname, "REGIONS ULTRAPERIPH") > 0)
*groups wpname if wpcode == "B14", order(h) miss


*groups wpname if wpcode != "B14" & (index(wpname, "ULTRAPERIPH") > 0)
replace wpcode2 = "B14" if wpcode != "B14" & wpcode2 == "" /*
	*/ & (index(wpname, "ULTRAPERIPH") > 0)
*groups wpname if wpcode2 == "B14", order(h) miss
list wpname wpcode wpcode2 wpcode3 if wpcode2 == "B14"

* Make correction
replace wpcode = "" if wpcode == "B14" & regexm(wpname, "POSEIDOM")
	
	
* Working Party on the Staff Regulations
replace wpcode = "B15" if wpcode == "" /*
	*/ & (index(wpname, "STATUT") > 0)
*groups wpname if wpcode == "B15", order(h) miss


* Working Party on New Buildings
replace wpcode = "B16" if wpcode == "" /*
	*/ & (index(wpname, "NOUVEAUX IMMEUBLES") > 0 /*
	*/ | index(wpname, "GROUPE IMMEUBLE") > 0)
*groups wpname if wpcode == "B16", order(h) miss


* Working Party on Electronic Transmission of Documents
* B17; replaced by B07 in November 1999
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & index(wpname, "LIAISONS ELEC") > 0
replace wpcode = "B17" if wpcode == "" /*
	*/ & index(wpname, "LIAISONS ELEC") > 0
*groups wpname if wpcode == "B17", order(h) miss
	
*groups wpname if wpcode != "B17" & wpcode != "Z00" /*
	*/ & index(wpname, "LIAISONS ELEC") > 0 /*
	*/ , order(h) show(freq Freq)

	
* Ad hoc Working Party on Drafting the Accession Treaty
replace wpcode = "B18" if wpcode == "" /*
	*/ & (index(wpname, "REDACTION TRAITE") > 0 /*
	*/ | index(wpname, "RED. TRAITE") > 0)
*groups wpname if wpcode == "B18", order(h) miss


* Make correction
replace wpcode = "" if wpcode == "B18" & regexm(wpname, "CROATIE")
* Corrections for 2007 enlargement have to be made by checking the timing


* Working Party on Statistics
replace wpcode = "B19" if wpcode == "" /*
	*/ & (wpname == "STATISTIQUES")
*groups wpname if wpcode == "B19", order(h) miss

replace wpcode = "B19" if wpname == "STATISTIQUES - SCIENCE ET TECHNOLOGIE"
replace wpcode = "B19" if wpname == "UNION DOUANIERE / STATISTIQUES"


* Ad hoc Working Party on Drafting the Accession Treaty (II)
* B20


* Working Party on Enlargement and Countries Negotiating Accession to the EU
replace wpcode = "B21" if wpcode == "" /*
	*/ & (index(wpname, "ELARGISSEMENT / PAYS NEG. ADHESION") > 0 /*
	*/ | index(wpname, "ELARGISSEMENT ET PAYS NEG. ACC. UE") > 0 /*
	*/ | index(wpname, "ELARGISSEMENT ET PAYS MENANT DES NEGOCI") > 0)
*groups wpname if wpcode == "B21", order(h) miss


* Ad hoc Working Party on the Follow-Up to the Council Conclusions on Cyprus of 26 April 2004
replace wpcode = "B22" if wpcode == "" /*
	*/ & (index(wpname, "GROUPE AD HOC 'CHYPRE'") > 0 /*
	*/ | index(wpname, "AD HOC SUR LE SUIVI DES CONCL") > 0)
*groups wpname if wpcode == "B22", order(h) miss


* Ad hoc Working Party on Greenland
replace wpcode = "B23" if wpcode == "" /*
	*/ & (index(wpname, "AD HOC GROENLAND") > 0 /*
	*/ | index(wpname, "AD HOC GREENLAND") > 0)
*groups wpname if wpcode == "B23", order(h) miss


* Ad hoc Working Party on the Cooperation and Verification Mechanism for Bulgaria and Romania
replace wpcode = "B24" if wpcode == "" /*
	*/ & (index(wpname, "AD HOC SUR LE MECANISME DE COOPERATION VERIF.") > 0)
*groups wpname if wpcode == "B24", order(h) miss
	
	
* Ad hoc Working Party on Drafting the Accession Treaty with Croatia
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ADH.*CROATIE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "B25" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ADH.*CROATIE")
*groups wpname if wpcode == "B25", order(h) miss

**groups wpname if wpcode != "B25" & wpcode != "Z00" /*
	*/ & regex(wpname, "ADH.*CROATIE") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on E-Law
replace wpcode = "B26" if wpcode == "" /*
	*/ & (index(wpname, "E - LAW") > 0)	
**groups wpname if wpcode == "B26", order(h) miss
	
	
* Ad hoc Working Party on Nuclear Safety
* This working party existed before as B12a; coding will be corrected as part of cross-validation with lifecycle data
* B27


* Ad hoc working party on POSEICAN, POSEIMA, and POSEIDOM (probably pre-1999)
* Possibly sub-group of WP on Outermost Regions
replace wpcode = "B28" if wpcode == "" /*
	*/ & (index(wpname, "POSEICAN") > 0 /*
	*/ | index(wpname, "POSEIMA") > 0 /*
	*/ | index(wpname, "POSEIDOM") > 0)
* Related to treatment of Canary Islands as outermost region
*groups wpname if wpcode == "B28", order(h) miss

replace wpcode = "B14" if wpcode == "B28" & date >= d(26nov1999)	/* Correct coding post-1999 */


* Meetings that fall within area but cannot be linked to particular group	
replace wpcode = "B00" if wpcode == "" /*
	*/ & (index(wpname, "BIO - PREPAREDNESS") > 0)
* Included attaches from different sectors
*groups wpname if wpcode == "B00", order(h) miss


* External Affairs
******************

* Working Party of Foreign Relations Counsellors: Sanctions
replace wpcode = "C01a" if wpcode == "" /*
	*/ & index(wpname, "CONSEILLERS RELATIONS EXTERIEURES") > 0 /*
	*/ & index(wpname, "SANC") > 0
*groups wpname if wpcode == "C01a", order(h) miss


* Working Party of Foreign Relations Counsellors
replace wpcode = "C01" if wpcode == "" /*
	*/ & (index(wpname, "CONSEILLERS POUR LES RELATIONS ETRANGERES") > 0 /*
	*/ | index(wpname, "CONSEILLERS RELATIONS ETRANGERES") > 0 /*
	*/ | index(wpname, "CONSEILLERS RELATIONS EXTERIEURES") > 0 /*
	*/ | index(wpname, "CONSEILLERS PESC") > 0)
*groups wpname if wpcode == "C01", order(h) miss

replace wpcode = "C01" if wpname == "CONJOINT EUROPE SUD - EST / PESC"
replace wpcode = "C01" if wpname == "CONJOINT TERRORISME + CONSEILLERS RELATIONS EXT."
	
	
* Working Party on Transatlantic Relations
*groups wpname if regexm(wpname, "REL.*TRANS") > 0
replace wpcode = "C02" if wpcode == "" /*
	*/ & regexm(wpname, "REL.*TRANS")
*groups wpname if wpcode == "C02", order(h) miss

replace wpcode2 = "C02" if wpcode != "C02" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "REL.*TRANS")
*groups wpname if wpcode2 == "C02", order(h) miss

* Working Party on EFTA
replace wpcode = "C03" if wpcode == "" /*
	*/ & (index(wpname, "AELE") > 0)
*groups wpname if wpcode == "C03", order(h) miss
	
	
* Working Party on the Western Balkans Region
replace wpcode = "C04" if wpcode == "" /*
	*/ & ((index(wpname, "BALKANS OCCIDENTAUX") > 0 /*
	*/ & index(wpname, "AMIS") == 0) /*
	*/ | index(wpname, "BALK. OCC") > 0 /*
	*/ | index(wpname, "REGION BALKANS") > 0 /*
	*/ | regexm(wpname, "(PESC.*PACTE)|(COORD.*PACTE)") > 0 /*
	*/ | index(wpname, "EX - YOUGOSLAVIE") > 0 /*
	*/ | index(wpname, "COWEB") > 0)
	* WP on Ex-Yugoslavia changed name at end of 1997 (12627/97, see 14703/07)
*groups wpname if wpcode == "C04", order(h) miss
	
*groups wpname if wpcode != "C04" & wpcode != "Z00" /*
	*/ & ((index(wpname, "BALKANS OCCIDENTAUX") > 0 /*
	*/ & index(wpname, "AMIS") == 0) /*
	*/ | index(wpname, "BALK. OCC") > 0 /*
	*/ | index(wpname, "REGION BALKANS") > 0 /*
	*/ | regexm(wpname, "(PESC.*PACTE)|(COORD.*PACTE)") > 0 /*
	*/ | index(wpname, "EX - YOUGOSLAVIE") > 0 /*
	*/ | index(wpname, "COWEB") > 0) /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C04" if wpcode != "C04" & wpcode != "Z00" & wpcode2 == ""  /*
	*/ & ((index(wpname, "BALKANS OCCIDENTAUX") > 0 /*
	*/ & index(wpname, "AMIS") == 0) /*
	*/ | index(wpname, "BALK. OCC") > 0 /*
	*/ | index(wpname, "REGION BALKANS") > 0 /*
	*/ | regexm(wpname, "(PESC.*PACTE)|(COORD.*PACTE)") > 0 /*
	*/ | index(wpname, "EX - YOUGOSLAVIE") > 0 /*
	*/ | index(wpname, "COWEB") > 0)
	
* Make correction
replace wpcode = "" if wpcode == "C04" & regexm(wpname, "FORUM UE")

replace wpcode2 = "C04" if wpcode != "C04" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & ((index(wpname, "BALKANS OCCIDENTAUX") > 0 /*
	*/ & index(wpname, "AMIS") == 0) /*
	*/ | index(wpname, "BALK. OCCID.") > 0 /*
	*/ | regexm(wpname, "(PESC.*PACTE)|(COORD.*PACTE)") > 0 /*
	*/ | index(wpname, "EX-YOUGOSLAVIE") > 0 /*
	*/ | index(wpname, "COWEB") > 0)
*groups wpname if wpcode2 == "C04", order(h) miss
	
* Make correction
replace wpcode2 = "" if wpcode2 == "C04" & regexm(wpname, "FORUM UE")


* Ad hoc Post-Lom� Working Party
replace wpcode = "C05" if wpcode == "" /*
	*/ & (index(wpname, "LOME") > 0)
*groups wpname if wpcode == "C05", order(h) miss

* Make correction
replace wpcode = "" if wpcode == "C05" & regexm(wpname, "DIPLOME")
replace wpcode = "" if wpcode == "C05" & regexm(wpname, "CONGLOME")
replace wpcode = "Z00" if wpname == "CONSULTATIONS LOME AVEC NIGER"
	
	
* ACP/FIN Working Party
replace wpcode = "C07" if wpcode == "" /*
	*/ & (index(wpname, "ACP / FIN") > 0)
*groups wpname if wpcode == "C07", order(h) miss
	
	
* ACP Working Party
replace wpcode = "C06" if wpcode == "" /*
	*/ & (index(wpname, "ACP") > 0)
*groups wpname if wpcode == "C06", order(h) miss

* Make correction
replace wpcode = "" if wpcode == "C06" & regexm(wpname, "COOPERATION DOUANIERE ACP - CE")
replace wpcode = "Z00" if wpcode == "C06" & regexm(wpname, "CONF. MINIST.")
replace wpcode = "Z00" if wpcode == "C06" & regexm(wpname, "COMITE AMBASSADEURS")
replace wpcode = "Z00" if wpcode == "C06" & regexm(wpname, "NEGOC.")
replace wpcode = "Z00" if wpcode == "C06" & regexm(wpname, "RENCONTRE PORTE - PAROLE ACP - UE")
replace wpcode = "Z00" if wpcode == "C06" & regexm(wpname, "ACP - UE")
replace wpcode = "Z00" if wpcode == "C06" & regexm(wpname, "CONSULT. ACCORD ACP - CE REP. CENTRAFRIQUE")
replace wpcode = "Z00" if wpcode == "C06" & regexm(wpname, "COOPERATION AU DEVELOPPEMENT SUIVI PAR ACP")

replace wpcode2 = "C06" if wpcode != "C06" & wpcode != "C07" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & (index(wpname, "ACP") > 0)
*groups wpname if wpcode2 == "C06", order(h) miss

* Make correction
replace wpcode2 = "" if wpname == "AD HOC LOME IV SUIVI PAR ACP"
replace wpcode2 = "" if wpcode2 == "C06" & regexm(wpname, "COOPERATION DOUANIERE ACP - CE")
	
	
* Africa Working Party
replace wpcode = "C08" if wpcode == "" /*
	*/ & (index(wpname, "AFRIQUE") > 0)
*groups wpname if wpcode == "C08", order(h) miss

* Make correction
replace wpcode = "" if wpcode == "C08" /*
	*/ & regexm(wpname, "(AFRIQUE AUSTRALE)|(AFRIQUE / SUD)|(AFRIQUE DU SUD)")
replace wpcode = "" if wpcode == "C08" /*
	*/ & regexm(wpname, "GROUPE AD HOC STRATEGIE CONJOINTE UE - AFRIQUE")	
replace wpcode = "" if wpcode == "C08" /*
	*/ & regexm(wpname, "DROGUE")
replace wpcode = "" if wpcode == "C08" /*
	*/ & regexm(wpname, "BI - REGIONALE H.F.")
replace wpcode = "Z00" if wpcode == "C08" /*
	*/ & regexm(wpname, "EU - AFRIQUE JOINT STRATEGY - PARTNERSHIP ON PEACE AND SECURITY")
replace wpcode = "Z00" if wpcode == "C08" /*
	*/ & regexm(wpname, "MME")
replace wpcode = "Z00" if wpcode == "C08" /*
	*/ & regexm(wpname, "AFRIQUE ?\(MIGRATION,? MOBILITE EMPLOI\)")
replace wpcode = "Z00" if wpcode == "C08" /*
	*/ & regexm(wpname, "SUIVI SOMMET AFRIQUE-EUROPE")

replace wpcode2 = "C08" if wpcode != "C08" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & (index(wpname, "AFRIQUE") > 0)
*groups wpname if wpcode2 == "C08", order(h) miss

replace wpcode = "C08" if wpname == "CONJOINT GROUPE POLITICO - MILITAIRE ET COAFR"

* Make correction
replace wpcode2 = "" if wpcode2 == "C08" /*
	*/ & regexm(wpname, "(AFRIQUE AUSTRALE)|(AFRIQUE / SUD)|(AFRIQUE DU SUD)")
replace wpcode2 = "" if wpcode2 == "C08" /*
	*/ & regexm(wpname, "GROUPE AD HOC STRATEGIE CONJOINTE UE - AFRIQUE")	
replace wpcode2 = "" if wpcode2 == "C08" /*
	*/ & regexm(wpname, "DROGUE")
replace wpcode2 = "" if wpcode2 == "C08" /*
	*/ & regexm(wpname, "BI - REGIONALE H.F.")

	
* Working Party on Eastern Europe and Central Asia
replace wpcode = "C11" if wpcode == "" /*
	*/ & regexm(wpname, "(EUROPE ORIEN)|(ASIE.*CENTR)|(COEST)")
*groups wpname if wpcode == "C11", order(h) miss

replace wpcode2 = "C11" if wpcode != "C11" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(EUROPE ORIEN)|(ASIE.*CENTR)|(COEST)")
*groups wpname if wpcode2 == "C11", order(h) miss

* Make correction
* Treated as sub-formations of Structural Measures WP
replace wpcode2 = "" if wpcode2 == "C11" /*
	*/ & regexm(wpname, "ACTIONS STRUCTURELLES (ELARG.+ MASH / MAGH.+ EUROPE ORIENTALE / ASIE CENTRALE)")

	
* Asia-Oceania Working Party
* WP on Asie has been renamed to Asie/Oceania in 1996 (CFSP Guide)
replace wpcode = "C09" if wpcode == "" /*
	*/ & regexm(wpname, "(ASIE)|(OCEANIA)|(ASIE.*OCE)|(COASI)")
*groups wpname if wpcode == "C09", order(h) miss

replace wpcode2 = "C09" if wpcode != "C09" & wpcode != "C11" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(ASIE)|(OCEANIA)|(ASIE.*OCE)|(COASI)")
*groups wpname if wpcode2 == "C09", order(h) miss

* Make corrections
replace wpcode = "" if wpcode == "C09" & regexm(wpname, "CODIA") /* CODIA stands for political dialogue */
	
	
* Working Party on Latin America
replace wpcode = "C10" if wpcode == "" /*
	*/ & regexm(wpname, "(AMER.*LAT)|(COLAT)")
*groups wpname if wpcode == "C10", order(h) miss

replace wpcode2 = "C10" if wpcode != "C10" & wpcode != "C11" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(AMER.*LAT)|(COLAT)")
*groups wpname if wpcode2 == "C10", order(h) miss

* Make corrections
replace wpcode = "" if wpcode == "C10" & regexm(wpname, "COOPERATION DOUANIERE") 


* Working Party on Central and South East Europe
replace wpcode = "C45" if wpcode == "" /*
	*/ & (regexm(wpname, "EUROPE CENTRALE.*SUD") > 0)
*groups wpname if wpcode == "C45", order(h) miss
	
	
* Working Party on Central Europe
replace wpcode = "C12" if wpcode == "" /*
	*/ & regexm(wpname, "(EUR.*CENTRAL)|(COCEN)")
*groups wpname if wpcode == "C12", order(h) miss


* Working Party on South East Europe
replace wpcode = "C13" if wpcode == "" /*
	*/ & regexm(wpname, "(EUR.* SUD)|(COSEE)")
*groups wpname if wpcode == "C13", order(h) miss


* Ad hoc Working Party on the Middle East Peace Process
replace wpcode = "C14" if wpcode == "" /*
	*/ & regexm(wpname, "(PAIX)|(COMEP)")
*groups wpname if wpcode == "C14", order(h) miss

count if wpcode != "C14" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(PAIX)|(COMEP)") 
replace wpcode2 = "C14" if wpcode != "C14" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(PAIX)|(COMEP)")
*groups wpname if wpcode2 == "C14", order(h) miss
	
* Make correction
replace wpcode = "" if wpname == "PROCESSUS BARCELONE - EURO - MED PAIX ET STABILITE"	
	
	
**
* Middle East/Gulf Working Party
replace wpcode = "C15" if wpcode == "" /*
	*/ & regexm(wpname, "(MOYEN)|(GOLFE)|( MOG)")
*groups wpname if wpcode == "C15", order(h) miss

*groups wpname if wpcode != "C15" & wpcode != "Z00" & wpcode != "C14" /*
	*/ & regexm(wpname, "(MOYEN)|(GOLFE)|( MOG)"), show(freq Freq)
replace wpcode2 = "C15" if wpcode != "C15" & wpcode != "Z00" & wpcode != "C14" & wpcode2 == "" /*
	*/ & regexm(wpname, "(MOYEN)|(GOLFE)|( MOG)")
*groups wpname if wpcode2 == "C15", order(h) miss

**groups wpname if wpcode != "C15" & wpcode2 != "C15" & wpcode != "C14" & wpcode2 != "C14" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(MOYEN)|(GOLFE)|( MOG)"), show(freq Freq)

replace wpcode = "C15" if wpname == "MOG"	
replace wpcode = "C15" if wpname == "CONJOINT MASHRAK / MAGHREB / M.O.G."	

	
**
* Mashrak/Maghreb Working Party
replace wpcode = "C16" if wpcode == "" /*
	*/ & regexm(wpname, "(MASH)|(MAGH)|(COMAG)|(MAMA)")
*groups wpname if wpcode == "C16", order(h) miss show(freq Freq)

*groups wpname if wpcode != "C16" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(MASH)|(MAGH)|(COMAG)|(MAMA)"), order(h) show(freq Freq)
replace wpcode2 = "C16" if wpcode != "C16" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(MASH)|(MAGH)|(COMAG)|(MAMA)")
*groups wpname if wpcode2 == "C16", order(h) miss show(freq Freq)

*groups wpname if wpcode != "C16" & wpcode2 != "C16" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(MASH)|(MAGH)|(COMAG)|(MAMA)"), order(h) show(freq Freq)
replace wpcode3 = "C16" if wpcode != "C16" & wpcode2 != "C16" & wpcode != "Z00" & wpcode3 == "" /*
	*/ & regexm(wpname, "(MASH)|(MAGH)|(COMAG)|(MAMA)")
*groups wpname if wpcode3 == "C16", order(h) miss show(freq Freq)	

replace wpcode = "C16" if wpname == "MAMA"	
replace wpcode2 = "C16" if wpname == "CONJOINT EUROPE ORIENTALE ET ASIE CENTRALE / MA / MA"	
replace wpcode2 = "C16" if wpname == "CONJOINT EUROPE ORIENTALE ET ASIE CENTRALE - MA / MA"	
replace wpcode2 = "C16" if wpname == "CONJOINT MA / MA / MOYEN - ORIENT / GOLFE"	


* Security Working Party
replace wpcode = "C17" if wpcode == "" /*
	*/ & (wpname == "SECURITE" /*
	*/ | wpname == "Salle 80.6: SECURITE" /*
	*/ | index(wpname, "COSEC") > 0  /*
	*/ | index(wpname, "COSEC") > 0  /*
	*/ | index(wpname, "PESC - SECURITE") > 0)
*groups wpname if wpcode == "C17", order(h) miss

*groups wpname if wpcode != "C17" & wpcode != "Z00" /*
	*/ & (wpname == "SECURITE" /*
	*/ | wpname == "Salle 80.6: SECURITE" /*
	*/ | index(wpname, "COSEC") > 0  /*
	*/ | index(wpname, "COSEC") > 0  /*
	*/ | index(wpname, "PESC - SECURITE") > 0), order(h) show(freq Freq)

replace wpcode2 = "C17" if wpcode != "C17" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & (wpname == "SECURITE" /*
	*/ | wpname == "Salle 80.6: SECURITE" /*
	*/ | index(wpname, "COSEC") > 0  /*
	*/ | index(wpname, "COSEC") > 0  /*
	*/ | index(wpname, "PESC - SECURITE") > 0)
*groups wpname if wpcode2 == "C17", order(h) miss show(freq Freq)
	
	
* Ad hoc Working Party on the Security Model
replace wpcode = "C18" if wpcode == "" /*
	*/ & (regexm(wpname, "MODEL.* SECURITE") /*
	*/ | regexm(wpname, "SECURITY MODEL"))
*groups wpname if wpcode == "C18", order(h) miss

**groups wpname if wpcode != "C18" & wpcode != "Z00" /*
	*/ & (regexm(wpname, "MODEL.* SECURITE") /*
	*/ | regexm(wpname, "SECURITY MODEL")), order(h) show(freq Freq)
	
	
* Working Party on Terrorism (International Aspects)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(TERR.*ASP.*INT)|(COTER)|(TERR.*2EME PILIER)|(PESC.*TERR)")
replace wpcode = "C19" if wpcode == "" /*
	*/ & regex(wpname, "(TERR.*ASP.*INT)|(COTER)|(TERR.*2EME PILIER)|(PESC.*TERR)")
*groups wpname if wpcode == "C19", order(h) miss

*groups wpname if wpcode != "C19" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(TERR.*ASP.*INT)|(COTER)|(TERR.*2EME PILIER)|(PESC.*TERR)"), order(h) show(freq Freq)

replace wpcode2 = "C19" if wpcode != "C19" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(TERR.*ASP.*INT)|(COTER)|(TERR.*2EME PILIER)|(PESC.*TERR)")
*groups wpname if wpcode2 == "C19", order(h) miss show(freq Freq)
	
* Make correction
replace wpcode = "C19" if wpname == "CONJOINT TERRORISME PESC / JAI"	
replace wpcode = "C19" if wpname == "CONJOINT CFSP / JHA TERRORISME"	
replace wpcode = "C19" if wpname == "TERRORISME - REUNION CONJOINTE"	
replace wpcode = "" if regexm(wpname, "LUTTE CONTRE LE TERRORISME")	
	
	
* Working Party on OSCE and the Council of Europe
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & (index(wpname, "OSCE") > 0), order(h) show(freq Freq)
replace wpcode = "C20" if wpcode == "" /*
	*/ & (index(wpname, "OSCE") > 0)
*groups wpname if wpcode == "C20", order(h) miss
	
*groups wpname if wpcode != "C20" & wpcode != "Z00" /*
	*/ & (index(wpname, "OSCE") > 0), order(h) show(freq Freq)
replace wpcode2 = "C20" if wpcode != "C20" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "OSCE")
*groups wpname if wpcode2 == "C20", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "C20" & wpcode2 != "C20" & wpcode != "Z00" /*
	*/ & (index(wpname, "OSCE") > 0), order(h) show(freq Freq)
	
	
* Working Party on Non-Proliferation
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CONOP)|(NON.*PRO)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C21" if wpcode == "" /*
	*/ & regex(wpname, "(CONOP)|(NON.*PRO)")
*groups wpname if wpcode == "C21", order(h) miss

*groups wpname if wpcode != "C21" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CONOP)|(NON.*PRO)(CONOP)|(NON.*PRO)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C21" if wpcode != "C21" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(CONOP)|(NON.*PRO)")
*groups wpname if wpcode2 == "C21", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "C21" & wpcode2 != "C21" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CONOP)|(NON.*PRO)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Conventional Arms Exports: Arms Trade Treaty
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ARM.*ATT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C22a" if wpcode == "" /*
	*/ & regex(wpname, "ARM.*ATT")
*groups wpname if wpcode == "C22a", order(h) miss

*groups wpname if wpcode != "C22a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ARM.*ATT") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Conventional Arms Exports
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COARM)|(ARM.*CONV)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C22" if wpcode == "" /*
	*/ & regex(wpname, "(COARM)|(ARM.*CONV)")
*groups wpname if wpcode == "C22", order(h) miss

*groups wpname if wpcode != "C22" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COARM)|(ARM.*CONV)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C22" if regexm(wpcode, "C22") == 0 & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(COARM)|(ARM.*CONV)")
*groups wpname if wpcode2 == "C22", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "C22" & wpcode2 != "C22" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COARM)|(ARM.*CONV)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Global Disarmament and Arms Control: SPACE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DESARM.*E?SPACE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C23a" if wpcode == "" /*
	*/ & regex(wpname, "DESARM.*E?SPACE")
*groups wpname if wpcode == "C23a", order(h) miss

*groups wpname if wpcode != "C23a" & wpcode != "Z00" /*
	*/ & regex(wpname, "DESARM.*E?SPACE") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Global Disarmament and Arms Control
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CODUN)|(DESARM)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C23" if wpcode == "" /*
	*/ & regex(wpname, "(CODUN)|(DESARM)")
*groups wpname if wpcode == "C23", order(h) miss

*groups wpname if wpcode != "C23" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CODUN)|(DESARM)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C23" if regexm(wpcode, "C23") == 0 & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(CODUN)|(DESARM)")
*groups wpname if wpcode2 == "C23", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "C23" & wpcode2 != "C23" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CODUN)|(DESARM)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Human Rights
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COHOM)|(HOMME)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C24" if wpcode == "" /*
	*/ & regex(wpname, "(COHOM)|(HOMME)")
*groups wpname if wpcode == "C24", order(h) miss

*groups wpname if wpcode != "C24" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COHOM)|(HOMME)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C24" if wpcode != "C24" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(COHOM)|(HOMME)")
*groups wpname if wpcode2 == "C24", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "C24" & wpcode2 != "C24" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COHOM)|(HOMME)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Public International Law: International Criminal Court
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(INT.*PUBLIC.*CPI)|(INT.*PUBLIC.*ICC)|(COUR PEN)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C25a" if wpcode == "" /*
	*/ & regex(wpname, "(INT.*PUBLIC.*CPI)|(INT.*PUBLIC.*ICC)|(COUR PEN)")
*groups wpname if wpcode == "C25a", order(h) miss

**groups wpname if wpcode != "C25a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(INT.*PUBLIC.*CPI)|(INT.*PUBLIC.*ICC)|(COUR PEN)") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Public International Law
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COJUR)|(INT.*PUBLIC)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C25" if wpcode == "" /*
	*/ & regex(wpname, "(COJUR)|(INT.*PUBLIC)")
*groups wpname if wpcode == "C25", order(h) miss

**groups wpname if wpcode != "C25" & wpcode != "C25a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COJUR)|(INT.*PUBLIC)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on the Law of the Sea
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DR.* MER") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C26" if wpcode == "" /*
	*/ & regex(wpname, "DR.* MER")
*groups wpname if wpcode == "C26", order(h) miss

**groups wpname if wpcode != "C26" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DR.* MER") /*
	*/ , order(h) show(freq Freq)

	
* United Nations Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CONUN)|(NATIONS UNIES)|(N\.U\.)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C27" if wpcode == "" /*
	*/ & regex(wpname, "(CONUN)|(NATIONS UNIES)|(N\.U\.)")
*groups wpname if wpcode == "C27", order(h) miss

*groups wpname if wpcode != "C27" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CONUN)|(NATIONS UNIES)|(N\.U\.)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C27" if wpcode != "C27" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(CONUN)|(NATIONS UNIES)|(N\.U\.)")
*groups wpname if wpcode2 == "C27", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "C27" & wpcode2 != "C27" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CONUN)|(NATIONS UNIES)|(N\.U\.)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Planning
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COPLA)|(PLANIF)|(PREVIS)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C28" if wpcode == "" /*
	*/ & regex(wpname, "(COPLA)|(PLANIF)|(PREVIS)")
* COPLA stands for WP on Planning (see 8404/01)
*groups wpname if wpcode == "C28", order(h) miss

**groups wpname if wpcode != "C28" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COPLA)|(PLANIF)|(PREVIS)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Consular Affairs
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COCON)|(AFF.*CONS)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C29" if wpcode == "" /*
	*/ & regex(wpname, "(COCON)|(AFF.*CONS)")
*groups wpname if wpcode == "C29", order(h) miss
	
**groups wpname if wpcode != "C29" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COCON)|(AFF.*CONS)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on CFSP Administrative Affairs and Protocol
* These were two separate working parties pre-1999
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COADM)|(COPRO)|(AFF.*ADM)|(PROTOC)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C30" if wpcode == "" /*
	*/ & regex(wpname, "(COADM)|(COPRO)|(AFF.*ADM)|(PROTOC)")
*groups wpname if wpcode == "C30", order(h) miss
	
**groups wpname if wpcode != "C30" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COADM)|(COPRO)|(AFF.*ADM)|(PROTOC)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Trade Questions
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(QUESTIONS COMM)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C31" if wpcode == "" /*
	*/ & regex(wpname, "(QUESTIONS COMM)")
*groups wpname if wpcode == "C31", order(h) miss

**groups wpname if wpcode != "C31" & wpcode != "Z00" /*
	*/ & regexm(wpname, "QUESTIONS COMM") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on the Generalised System of Preferences
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(PREF.*GEN)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C32" if wpcode == "" /*
	*/ & regex(wpname, "(PREF.*GEN)")
*groups wpname if wpcode == "C32", order(h) miss

**groups wpname if wpcode != "C32" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(PREF.*GEN)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Commodities
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(PROD.*BAS)|(PROBA)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C33" if wpcode == "" /*
	*/ & regex(wpname, "(PROD.*BAS)|(PROBA)")
*groups wpname if wpcode == "C33", order(h) miss

**groups wpname if wpcode != "C33" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(PROD.*BAS)|(PROBA)") /*
	*/ , order(h) show(freq Freq)

replace wpcode = "" if wpcode == "C33" & regexm(wpname, "FAO")
	
	
* Export Credits Group
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CRED.*EXPO") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C34" if wpcode == "" /*
	*/ & regex(wpname, "CRED.*EXPO")
*groups wpname if wpcode == "C34", order(h) miss
	
**groups wpname if wpcode != "C34" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CRED.*EXPO") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Dual-Use Goods
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DOUB.*USAGE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C35" if wpcode == "" /*
	*/ & regex(wpname, "DOUB.*USAGE")
*groups wpname if wpcode == "C35", order(h) miss
	
**groups wpname if wpcode != "C35" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DOUB.*USAGE") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Fairs and Exhibitions
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(FOIRES)|(EXPOS)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C36" if wpcode == "" /*
	*/ & regex(wpname, "(FOIRES)|(EXPOS)")
*groups wpname if wpcode == "C36", order(h) miss

**groups wpname if wpcode != "C36" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(FOIRES)|(EXPOS)") /*
	*/ , order(h) show(freq Freq)

	
* RELEX Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regexm(wpname, "^RELEX") /*
	*/ | (regexm(wpname, " RELEX") & regexm(wpname, "(JAI)|(BRIEF)") == 0) /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C37" if wpcode == ""  /*
	*/ & regexm(wpname, "^RELEX") /*
	*/ | (regexm(wpname, " RELEX") & regexm(wpname, "(JAI)|(BRIEF)") == 0)
*groups wpname if wpcode == "C37", order(h) miss

*groups wpname if wpcode != "C37" & wpcode != "Z00" /*
	*/ & regexm(wpname, "^RELEX") /*
	*/ | (regexm(wpname, " RELEX") & regexm(wpname, "(JAI)|(BRIEF)") == 0) /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C37" if wpcode != "C37" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "^RELEX") /*
	*/ | (regexm(wpname, " RELEX") & regexm(wpname, "(JAI)|(BRIEF)") == 0)

	
* Interim Political and Security Committee
* Hardly any observatins that explicitely state interim status
* Also, Political Committee pre-1999 is also coded as Political and Security Committee
* Thus, coding this separately would not make much sense
* C38
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COMITE POLITIQUE ET DE SECURITE INTERIMAIRE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C38" if wpcode == "" /*
	*/ & regex(wpname, "COMITE POLITIQUE ET DE SECURITE INTERIMAIRE")
*groups wpname if wpcode == "C38", order(h) miss

*groups wpname if wpcode != "C38" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COMITE POLITIQUE ET DE SECURITE INTERIMAIRE") /*
	*/ , order(h) show(freq Freq)
	
	
* Military Committee Working Party	
* This group has no joint meetings with Military Committee, but with Politico-Military Group
* Interim Military Group is coded as working group, Interim Military Body as committee
* MILEX seems to be exclusively dealt with by MCWG
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & (regex(wpname, "(GTMI)|(GROUPE MILI.*INTERIM)|(TRAV.*COMITE)|(TRAVAIL MIL)|(EUMC ?W[PG])|(WGEUMC)|(EUMC WORKING GROUP)|(CMUE)|(G\.?T\.? COMITE)") /*
	*/ | regexm(wpname, "MILEX")) /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C40" if wpcode == "" & wpcode != "Z00" /*
	*/ & (regex(wpname, "(GTMI)|(GROUPE MILI.*INTERIM)|(TRAV.*COMITE)|(TRAVAIL MIL)|(EUMC ?W[PG])|(WGEUMC)|(EUMC WORKING GROUP)|(CMUE)|(G\.?T\.? COMITE)") /*
	*/ | regexm(wpname, "MILEX"))
*groups wpname if wpcode == "C40", order(h) miss
	
*groups wpname if wpcode != "C40" & wpcode != "Z00" /*
	*/ & (regex(wpname, "(GTMI)|(GROUPE MILI.*INTERIM)|(TRAV.*COMITE)|(TRAVAIL MIL)|(EUMC ?W[PG])|(WGEUMC)|(EUMC WORKING GROUP)|(CMUE)|(G\.?T\.? COMITE)") /*
	*/ | regexm(wpname, "MILEX")) /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C40" if wpcode != "C40" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & (regex(wpname, "(GTMI)|(GROUPE MILI.*INTERIM)|(TRAV.*COMITE)|(TRAVAIL MIL)|(EUMC ?W[PG])|(WGEUMC)|(EUMC WORKING GROUP)|(CMUE)|(G\.?T\.? COMITE)") /*
	*/ | regexm(wpname, "MILEX"))
*groups wpname if wpcode2 == "C40", order(h) miss show(freq Freq)	

* Make correction
replace wpcode = "" if wpname == "GROUPE TRAVAIL SIS - TECH (COMITE MIXTE ISL. / NORV.)"
	
	
* Military Committee
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(ORG.*MILI.*INTERIM)|(COMITE MIL)|(CHOD)|(EUMC EXPERTS)|(EUMC$)|(^E?UMC )|(EUMC [A-V])") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C39" if wpcode == "" /*
	*/ & regex(wpname, "(ORG.*MILI.*INTERIM)|(COMITE MIL)|(CHOD)|(EUMC EXPERTS)|(EUMC$)|(^E?UMC )|(EUMC [A-V])")
*groups wpname if wpcode == "C39", order(h) miss

* Make correction
replace wpcode = "C39" if wpcode == "" /*
	*/ & regex(wpname, "GROUPE POL. MILITAIRE / EUMC / EXPERTS NAT.")
replace wpcode = "C39" if wpcode == "" /*
	*/ & regex(wpname, "ko :EUMC / HEADLINE GOAL TASK FORCE")
	
*groups wpname if wpcode != "C39" & wpcode != "C40" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(ORG.*MILI.*INTERIM)|(COMITE MIL)|(CHOD)|(EUMC EXPERTS)|(EUMC$)|(^E?UMC )|(EUMC [A-V])") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C39" if wpcode != "C39" & wpcode != "C40" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(ORG.*MILI.*INTERIM)|(COMITE MIL)|(CHOD)|(EUMC EXPERTS)|(EUMC$)|(^E?UMC )|(EUMC [A-V])")
*groups wpname if wpcode2 == "C39", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "C39" & wpcode != "C40" & wpcode2 != "C39" & wpcode2 != "C40" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(ORG.*MILI.*INTERIM)|(COMITE MIL)|(CHOD)|(EUMC EXPERTS)|(EUMC$)|(^E?UMC )|(EUMC [A-V])") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Drugs (CODRO)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CODRO)|(DROGUES)|(Drogues)") /*
	*/ & regexm(wpname, "(TRAFIC)|(CRIM)|(SYNTH)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C41" if wpcode == "" /*
	*/ & regex(wpname, "(CODRO)|(DROGUES)|(Drogues)") /*
	*/ & regexm(wpname, "(TRAFIC)|(CRIM)|(SYNTH)|(CONSEILLERS JAI)") == 0
*groups wpname if wpcode == "C41", order(h) miss

*groups wpname if wpcode != "C41" & wpcode != "B04" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CODRO)|(DROGUES)|(Drogues)") /*
	*/ & regexm(wpname, "(TRAFIC)|(CRIM)|(SYNTH)|(CONSEILLERS JAI)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C41" if wpcode != "C41" & wpcode != "B04" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "(CODRO)|(DROGUES)|(Drogues)") /*
	*/ & regexm(wpname, "(TRAFIC)|(CRIM)|(SYNTH)|(CONSEILLERS JAI)") == 0
*groups wpname if wpcode2 == "C41", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "C41" & wpcode != "B04" & wpcode2 != "C41" & wpcode2 != "B04" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CODRO)|(DROGUES)|(Drogues)") /*
	*/ & regexm(wpname, "(TRAFIC)|(CRIM)|(SYNTH)|(CONSEILLERS JAI)") == 0 /*
	*/ , order(h) show(freq Freq)

* Correction
replace wpcode = "Z00" if regexm(wpname, "UE TURQUIE DROGUES")
replace wpcode = "C41" if wpname == "GROUPE CONJOINT COOPERATION DOUAN. / DROGUES + CRIM."

	
* CFSP Communications Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COTEL)|(PESC.*COMMUNI)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C42" if wpcode == "" /*
	*/ & regex(wpname, "(COTEL)|(PESC.*COMMUNI)")
*groups wpname if wpcode == "C42", order(h) miss
	
*groups wpname if wpcode != "C42" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COTEL)|(PESC.*COMMUNI)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C42" if wpcode != "C42" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "(COTEL)|(PESC.*COMMUNI)")
*groups wpname if wpcode2 == "C42", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "C42" & wpcode2 != "C42" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COTEL)|(PESC.*COMMUNI)") /*
	*/ , order(h) show(freq Freq)
	
	
* Committee for Civilian Aspects of Crisis Management	
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CIVCOM)|(COMITE.*CIV.*GEST)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C43" if wpcode == "" /*
	*/ & regex(wpname, "(CIVCOM)|(COMITE.*CIV.*GEST)")
*groups wpname if wpcode == "C43", order(h) miss

groups wpname if wpcode != "C43" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CIVCOM)|(COMITE.*CIV.*GEST)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C43" if wpcode != "C43" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(CIVCOM)|(COMITE.*CIV.*GEST)")
*groups wpname if wpcode2 == "C43", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "C43" & wpcode2 != "C43" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CIVCOM)|(COMITE.*CIV.*GEST)") /*
	*/ , order(h) show(freq Freq)
	
	
* Politico-Military Working Party
groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(PMG)|(POL.*MIL)|(EXERCISE)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C44" if wpcode == "" /*
	*/ & regex(wpname, "(PMG)|(POL.*MIL)|(EXERCISE)")
*groups wpname if wpcode == "C44", order(h) miss

*groups wpname if wpcode != "C44" & wpcode != "Z00" /*
	*/ & regex(wpname, "(PMG)|(POL.*MIL)") /*
	*/ , order(h) show(freq Freq)
* 'EXERCISE' term is deliberately omitted
replace wpcode2 = "C44" if wpcode != "C44" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "(PMG)|(POL.*MIL)")
*groups wpname if wpcode2 == "C44", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "C44" & wpcode2 != "C44" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(PMG)|(POL.*MIL)|(EXERCISE)") /*
	*/ , order(h) show(freq Freq)
	

* Nikolaidis Group
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "NI[CK]OLAIDIS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C46" if wpcode == "" /*
	*/ & regex(wpname, "NI[CK]OLAIDIS")
*groups wpname if wpcode == "C46", order(h) miss
	
**groups wpname if wpcode != "C46" & wpcode != "Z00" /*
	*/ & regexm(wpname, "NI[CK]OLAIDIS") /*
	*/ , order(h) show(freq Freq)

	
* Ad hoc Preparation Group on Defence Capabilities Development, Research, Acquisitions and Armaments
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AD HOC PREPARATION") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C47" if wpcode == "" /*
	*/ & regex(wpname, "AD HOC PREPARATION")
*groups wpname if wpcode == "C47", order(h) miss
	
*groups wpname if wpcode != "C47" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AD HOC PREPARATION") /*
	*/ , order(h) show(freq Freq)

	
* Ad hoc Working Party on Joint EU-Africa Strategy
* GROUPE AD HOC STRATEGIE CONJOINTE UE - AFRIQUE	
	
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "STRATEGIE CONJOINTE UE - AFRIQUE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C48" if wpcode == "" /*
	*/ & regex(wpname, "STRATEGIE CONJOINTE UE - AFRIQUE")
*groups wpname if wpcode == "C48", order(h) miss
	
*groups wpname if wpcode != "C48" & wpcode != "Z00" /*
	*/ & regexm(wpname, "STRATEGIE CONJOINTE UE - AFRIQUE") /*
	*/ , order(h) show(freq Freq)


* Working Party on the Application of Specific Measures to Combat Terrorism
* Application de mesures sp�cifiques en vue de lutter contre le terrorisme
* Note that meetings of this working party are held in secret, see 10826/1/07
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "LUTTE CONTRE LE TERRORISME") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C49" if wpcode == "" /*
	*/ & regexm(wpname, "LUTTE CONTRE LE TERRORISME") & date >= d(27jun2007)
*groups wpname if wpcode == "C49", order(h) miss
	
*groups wpname if wpcode != "C49" & wpcode != "Z00" /*
	*/ & regexm(wpname, "LUTTE") /*
	*/ , order(h) show(freq Freq)
* No observations
	
		
* South Africa Working Party (merged with Africa group, probably in 1999)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(AFR.*AUST)|(AFR.*SUD)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C50" if wpcode == "" /*
	*/ & regex(wpname, "(AFR.*AUST)|(AFR.*SUD)")
*groups wpname if wpcode == "C50", order(h) miss
	
*groups wpname if wpcode != "C50" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(AFR.*AUST)|(AFR.*SUD)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "C50" if wpcode != "C50" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(AFR.*AUST)|(AFR.*SUD)")
*groups wpname if wpcode2 == "C50", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "C50" & wpcode2 != "C50" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(AFR.*AUST)|(AFR.*SUD)") /*
	*/ , order(h) show(freq Freq)
	
	
* Interim Military Working Party/Military Committee Working Group (EUMCWG): Headline Task Force
* Not officially a Council working group until 22/06/2011, but closely connected to EUMCWG	
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(HEADLINE (GOAL )?TASK FORCE)|(HTF)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C40a" if wpcode == "" /*
	*/ & regexm(wpname, "(HEADLINE (GOAL )?TASK FORCE)|(HTF)")
*groups wpname if wpcode == "C40a", order(h) miss

*groups wpname if wpcode != "C40a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(HEADLINE (GOAL )?TASK FORCE)|(HTF)") /*
	*/ , order(h) show(freq Freq)
* Corrections
replace wpcode = "C40a" if wpcode != "C40a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(HEADLINE (GOAL )?TASK FORCE)|(HTF)")

	
* Remaining observations with PESC prefix
list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PESC ")
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PESC ") /*
	*/ & regexm(wpname, "(ELECTION)|(MERCOSUR)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C00" if wpcode == "" /*
	*/ & regexm(wpname, "PESC ") /*
	*/ & regexm(wpname, "(ELECTION)|(MERCOSUR)") == 0
*groups wpname if wpcode == "C00", order(h) miss

*groups wpname if regexm(wpcode, "C") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "PESC ") /*
	*/ & regexm(wpname, "(ELECTION)|(MERCOSUR)") == 0 /*
	*/ , order(h) show(freq Freq)
	
	
* CME stands for Crisis Management Exercise
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CME") /*
	*/ , order(h) show(freq Freq)	
replace wpcode = "C00" if wpcode == "" /*
	*/ & regexm(wpname, "CME")
	
	
* Political Directors meetings
* Could be part of PSC, but not sure
list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DIR.*POL")
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DIR.*POL") /*
	*/ , order(h) show(freq Freq)	
replace wpcode = "Z00" if wpcode == "" /*
	*/ & regexm(wpname, "DIR.*POL")


* Development
*************

* Working Party on Development Cooperation
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COOP.*DEV)|(CODEV)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "D01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COOP.*DEV)|(CODEV)")
*groups wpname if wpcode == "D01", order(h) miss

groups wpname if wpcode != "D01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COOP.*DEV)|(CODEV)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "D01" if wpcode != "D01" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(COOP.*DEV)|(CODEV)")

* Make correction
replace wpcode = "" if wpname == "PREP. CONFERENCES INTERNAT. (COOPERATION AU DEVELOPPEMENT)"
replace wpcode2 = "D01" if wpname == "CONJOINT 133 SUPPLEANTS / DEVELOPPEMENT"
replace wpcode2 = "D01" if wpname == "CONJOINT AFRIQUE / DEVELOPPEMENT / HLWG"
	
	
* Working Party on Food aid	
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AIDE ALIM") /*
	*/ & regex(wpname, "HUM") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "D02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AIDE ALIM") /*
	*/ & regex(wpname, "HUM") == 0
*groups wpname if wpcode == "D02", order(h) miss
	
*groups wpname if wpcode != "D02" & wpcode != "Z00" /*
	*/ & regex(wpname, "AIDE ALIM") /*
	*/ & regex(wpname, "HUM") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "D02" if wpcode != "D02" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "AIDE ALIM") /*
	*/ & regex(wpname, "HUM") == 0
*groups wpname if wpcode2 == "D02", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "D02" & wpcode2 != "D02" & wpcode != "Z00" /*
	*/ & regex(wpname, "AIDE ALIM") /*
	*/ & regex(wpname, "HUM") == 0 /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Preparation for International Development Conferences	
* Apparently, this working party did not meet
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PREP.*CONF")
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HABITAT")
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & (regex(wpname, "PREP.*CONF.*((DEV)|(INT)|(DESERT))") /*
	*/ | regex(wpname, "HABITAT")) /*
	*/ , order(h) show(freq Freq)
replace wpcode = "D03" if wpcode == "" & wpcode != "Z00" /*
	*/ & (regex(wpname, "PREP.*CONF.*((DEV)|(INT)|(DESERT))") /*
	*/ | regex(wpname, "HABITAT"))
*groups wpname if wpcode == "D03", order(h) miss

*groups wpname if wpcode != "D03" & wpcode2 != "D03" & wpcode != "Z00" /*
	*/ & (regex(wpname, "PREP.*CONF.*((DEV)|(INT)|(DESERT))") /*
	*/ | regex(wpname, "HABITAT")) /*
	*/ , order(h) show(freq Freq)	

	
* Ad hoc Working Party on Harmonisation
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AD HOC HARM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "D04" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AD HOC HARM")
*groups wpname if wpcode == "D04", order(h) miss

**groups wpname if wpcode != "D04" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AD HOC HARM") /*
	*/ , order(h) show(freq Freq)


* Working Party on Humanitarian Aid and Food Aid
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AIDE ALIM") /*
	*/ & regex(wpname, "HUM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "D05" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AIDE ALIM") /*
	*/ & regex(wpname, "HUM")
*groups wpname if wpcode == "D05", order(h) miss
	
**groups wpname if wpcode != "D05" & wpcode != "Z00" /*
	*/ & regex(wpname, "AIDE ALIM") /*
	*/ & regex(wpname, "HUM") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "D05" if wpcode != "D05" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "AIDE ALIM") /*
	*/ & regex(wpname, "HUM")

	
* Budget
********

* Budget Committee
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COMITE BUDG") /*
	*/ & regex(wpname, "(PROT.*INT.*FIN)|(TRILOGUE)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "E01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COMITE BUDG") /*
	*/ & regex(wpname, "(PROT.*INT.*FIN)|(TRILOGUE)") == 0	
*groups wpname if wpcode == "E01", order(h) miss

*groups wpname if wpcode != "E01" & wpcode != "Z00" /*
	*/ & regex(wpname, "COMITE BUDG") /*
	*/ & regex(wpname, "(PROT.*INT.*FIN)|(TRILOGUE)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "E01" if wpcode != "E01" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "COMITE BUDG") /*
	*/ & regex(wpname, "(PROT.*INT.*FIN)|(TRILOGUE)") == 0
*groups wpname if wpcode2 == "E01", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "E01" & wpcode2 != "E01" & wpcode != "Z00" /*
	*/ & regex(wpname, "COMITE BUDG") /*
	*/ & regex(wpname, "(PROT.*INT.*FIN)|(TRILOGUE)") == 0 /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on the Protection of the Communities' Financial Interests
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "INTER.*FIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "E02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "INTER.*FIN")
*groups wpname if wpcode == "E02", order(h) miss
	
**groups wpname if wpcode != "E02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "INTER.*FIN") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Combating Fraud
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "LUTTE.*FRAUD") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "E03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "LUTTE.*FRAUD")
*groups wpname if wpcode == "E03", order(h) miss
	
**groups wpname if wpcode != "E03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "LUTTE.*FRAUD") /*
	*/ , order(h) show(freq Freq)


* Economic and Financial Affairs
********************************

	
* Economic Policy Committee
*groups wpname if wpcode != "Z00" /*
	*/ & regex(wpname, "POL.*ECON") /*
	*/ , order(h) show(freq Freq)
* Only one observation, usually serviced by Commission	
replace wpcode = "Z00" if wpname == "COMITE POLITIQUE ECONOMIQUE"
	
	
* Working Party on Financial Questions: Own Resources
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "QUEST.* FIN.*RES.*PROP") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F02a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "QUEST.* FIN.*RES.*PROP")	
*groups wpname if wpcode == "F02a", order(h) miss
	
**groups wpname if wpcode != "F02a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "QUEST.* FIN.*RES.*PROP") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Questions
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "QUEST.* FIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "QUEST.* FIN")
*groups wpname if wpcode == "F02", order(h) miss

**groups wpname if wpcode != "F02" wpcode != "F02a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "") /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode = "" if wpname == "QUESTIONS FINANCIERES UEM"
* Coded as EMU Working Party (see below)
replace wpcode = "" if wpname == "ATTACHES FIN. LIQUIDATION BANQUES"
* Codes as Financial Services subgroup
replace wpcode = "" if wpcode == "F02" & regexm(wpname, "(FISC.*IND)|(TVA)")
replace wpcode = "" if wpcode == "F02" & regexm(wpname, "((FISC)|(TAX)).* DIR")
* Coded as WP on Tax Question (pre-1999 terminology not consistent)
replace wpcode = "" if wpname == "QUESTIONS SOCIALES + CONSEILLERS FINANCIERS"
replace wpcode = "" if wpname == "CONJOINT QUESTIONS SOCIALES / CONSEILLERS FIN."

	
* Working Party of Financial Counsellors
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((CONSEILLERS)|(ATTACHES)) FIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((CONSEILLERS)|(ATTACHES)) FIN")
*groups wpname if wpcode == "F03", order(h) miss
	
*groups wpname if wpcode != "F03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "((CONSEILLERS)|(ATTACHES)) FIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "F03" if wpcode != "F03" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "((CONSEILLERS)|(ATTACHES)) FIN")
*groups wpname if wpcode2 == "F03", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "F03" & wpcode2 != "F03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "((CONSEILLERS)|(ATTACHES)) FIN") /*
	*/ , order(h) show(freq Freq)

* Make correction
replace wpcode = "" if wpcode == "F03" & regexm(wpname, "(FISC.*IND)|(TVA)")
* Coded as WP on Tax Question


* EMU Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "( UEM)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F04" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "( UEM)")
*groups wpname if wpcode == "F04", order(h) miss
	
**groups wpname if wpcode != "F04" & wpcode != "Z00" /*
	*/ & regexm(wpname, "( UEM)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on ECOFIN Statistics
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "STAT.*ECOFIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F05" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "STAT.*ECOFIN")
*groups wpname if wpcode == "F05", order(h) miss
	
*groups wpname if wpcode != "F05" & wpcode != "Z00" /*
	*/ & regexm(wpname, "STAT.*ECOFIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "F05" if wpcode != "F05" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "STAT.*ECOFIN")
*groups wpname if wpcode2 == "F05", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "F05" & wpcode2 != "F05" & wpcode != "Z00" /*
	*/ & regexm(wpname, "STAT.*ECOFIN") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Financial Services: Electronic Money
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MON.*ELEC") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MON.*ELEC")
*groups wpname if wpcode == "F06a", order(h) miss
	
**groups wpname if wpcode != "F06a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MON.*ELEC") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: Undertakings for Collective Investment in Transferable Securities (UCITs)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "( MOBILIER)|(OPCVM)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "( MOBILIER)|(OPCVM)")
*groups wpname if wpcode == "F06b", order(h) miss
	
**groups wpname if wpcode != "F06b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "( MOBILIER)|(OPCVM)") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: Money Laundering
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BLANCH") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06c" if  wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BLANCH")
*groups wpname if wpcode == "F06c", order(h) miss
	
**groups wpname if wpcode != "F06c" & wpcode != "Z00" /*
	*/ & regexm(wpname, "BLANCH") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: Winding up of credit institutions
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "LIQUID") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06d" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "LIQUID")
*groups wpname if wpcode == "F06d", order(h) miss
	
**groups wpname if wpcode != "F06d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "LIQUID") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: Institutions for Occupational Pension Provisions
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RET.*PROF") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06e" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RET.*PROF")
*groups wpname if wpcode == "F06e", order(h) miss
		
**groups wpname if wpcode != "F06e" & wpcode != "Z00" /*
	*/ & regexm(wpname, "RET.*PROF") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: Financial Conglomerates
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CONGL)|(CONGOL)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06f" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CONGL)|(CONGOL)")
*groups wpname if wpcode == "F06f", order(h) miss
		
**groups wpname if wpcode != "F06f" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CONGL)|(CONGOL)") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: Market Abuse
groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ABUS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06g" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ABUS")
*groups wpname if wpcode == "F06g", order(h) miss
	
**groups wpname if wpcode != "F06g" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ABUS") /*
	*/ , order(h) show(freq Freq)

* Make correction
replace wpcode = "" if wpcode == "F06g" & regexm(wpname, "CONSEILLERS JAI \(MARKET ABUSE DIRECTIVE\)")

	
* Working Party on Financial Services: Prospectus
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROSPECTUS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06h" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROSPECTUS")
*groups wpname if wpcode == "F06h", order(h) miss
	
**groups wpname if wpcode != "F06h" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PROSPECTUS") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: Financial Collateral
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(GARANTIES)|(COLL)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06i" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(GARANTIES)|(COLL)")
*groups wpname if wpcode == "F06i", order(h) miss

**groups wpname if wpcode != "F06i" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(GARANTIES)|(COLL)") /*
	*/ , order(h) show(freq Freq)

* Make correction
replace wpcode = "" if regexm(wpname, "GROUPE EVALUATION COLLECTIVE")

	
* Working Party on Financial Services: Transparency
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(TRANSPARE)|(Transpare)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06j" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(TRANSPARE)|(Transpare)")
*groups wpname if wpcode == "F06j", order(h) miss
	
**groups wpname if wpcode != "F06j" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(TRANSPARE)|(Transpare)") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: Investment Services
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SERV.*INVEST") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06k" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SERV.*INVEST")
*groups wpname if wpcode == "F06k", order(h) miss
		
**groups wpname if wpcode != "F06k" & wpcode != "A04i" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SERV.*INVEST") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: Money Laundering (II)
* Can only be distinguished from first sub-group on money laundering by date
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "REASS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06m" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "REASS")
*groups wpname if wpcode == "F06m", order(h) miss

**groups wpname if wpcode != "F06m" & wpcode != "Z00" /*
	*/ & regexm(wpname, "REASS") /*
	*/ , order(h) show(freq Freq)
*list date wpname wpcode if wpcode != "F06l" & wpcode != "Z00" /*
	*/ & regexm(wpname, "BLANCH")

* Make correction
replace wpcode = "F06l" if wpcode == "F06c" & date == d(28apr2005)
	
	
* Working Party on Financial Services: Reinsurance
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "REASS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06m" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "REASS")
*groups wpname if wpcode == "F06m", order(h) miss

**groups wpname if wpcode != "F06m" & wpcode != "Z00" /*
	*/ & regexm(wpname, "REASS") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: Capital Requirements
* Exigences de capital
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "CAP") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06n" if wpcode == "" /*
	*/ & regexm(wpname, "EXIGENCES DE CAPITAL")
*groups wpname if wpcode == "F06n", order(h) miss

*groups wpname if wpcode != "F06n" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CAP") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Financial Services: Payment Services
* Services de paiement
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "PAIEM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06o" if wpcode == "" /*
	*/ & regexm(wpname, "SERVICES DE PAIEMENT")
*groups wpname if wpcode == "F06o", order(h) miss
	
*groups wpname if wpcode != "F06o" & wpcode != "Z00" /*
	*/ & regexm(wpname, "") /*
	*/ , order(h) show(freq Freq)	
* No observations


* Working Party on Financial Services: Funds Transfers
* Transferts de fonds
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "FOND") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06p" if wpcode == "" /*
	*/ & regexm(wpname, "TRANSFERTS DE FONDS")
*groups wpname if wpcode == "F06p", order(h) miss
	
*groups wpname if wpcode != "F06p" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FOND") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Financial Services: Solvency II
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SOLVENCY") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06q" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SOLVENCY")
*groups wpname if wpcode == "F06q", order(h) miss
	
**groups wpname if wpcode != "F06q" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SOLVENCY") /*
	*/ , order(h) show(freq Freq)

* Make correction
replace wpcode = "" if wpcode == "F06q" & regexm(wpname, "INSOLVENCY")	
	
	
* Working Party on Financial Services: Comitology
* Comitologie
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "COMITOL") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06r" if wpcode == "" /*
	*/ & regexm(wpname, "COMITOLOGIE") /*
	*/ & regexm(wpname, "PRESIDENCE") == 0
*groups wpname if wpcode == "F06r", order(h) miss
	
*groups wpname if wpcode != "F06r" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COMITOL") /*
	*/ , order(h) show(freq Freq)	
* No observations


* Working Party on Financial Services: Settlement Finality/Financial Collateral
* Caract�re d�finitif du r�glement/Garantie financi�re
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "(DEFINIT)|(GARANT)|(CARACT)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06s" if wpcode == "" /*
	*/ & regexm(wpname, "(DEFINIT)|(GARANT)|(CARACT)")
*groups wpname if wpcode == "F06s", order(h) miss
	
*groups wpcode wpname if wpcode != "F06s" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(DEFINIT)|(GARANT)|(CARACT)") /*
	*/ , order(h) show(freq Freq)
*list wpcode wpname date if wpcode != "F06s" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(DEFINIT)|(GARANT)|(CARACT)")
* No observations, all meetings belong to previous working party sub-group F06i


* Working Party on Financial Services: Capital Requirements (II)
* Exigences de capital
groups wpname if wpcode != "F06t" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(EXIG)|(CAPITAL)") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Financial Services: E-Money Institutions
* �tablissements de monnaie �lectronique
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "MONNAIE ELECTRONIQUE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06u" if wpcode == "" /*
	*/ & regexm(wpname, "MONNAIE ELECTRONIQUE")
*groups wpname if wpcode == "F06u", order(h) miss
	
*groups wpname if wpcode != "F06u" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MONNAIE ELECTRONIQUE") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode != "F06u" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MONNAIE ELECTRONIQUE")
* No observations, all dates long before establishment of working party
	

* Working Party on Financial Services: Credit Rating Agencies
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CRA)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06v" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CRA)")
*groups wpname if wpcode == "F06v", order(h) miss

**groups wpname if wpcode != "F06v" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CRA)") /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode = "Z00" if regexm(wpname, "FRIENDS OF DEMOCRATIC PAKISTAN")


* Working Party on Financial Services: Cross-Border Payments
* Paiements transfrontaliers
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "PAIEM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06w" if wpcode == "" /*
	*/ & regexm(wpname, "PAIEMENTS TRANSFRONT")
*groups wpname if wpcode == "F06w", order(h) miss
	
*groups wpname if wpcode != "F06w" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PAIEM") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Financial Services: Alternative Investment Fund Managers
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AIFMD") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06x" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AIFMD")
*groups wpname if wpcode == "F06x", order(h) miss

**groups wpname if wpcode != "F06x" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AIFMD") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: Financial Supervision
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FIN.*SUPERV") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06y" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FIN.*SUPERV")
*groups wpname if wpcode == "F06y", order(h) miss
	
**groups wpname if wpcode != "F06y" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FIN.*SUPERV") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: Deposit Guarantee Schemes
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(DGS)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06ya" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(DGS)")
*groups wpname if wpcode == "F06A", order(h) miss
	
**groups wpname if wpcode != "F06A" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(DGS)") /*
	*/ , order(h) show(freq Freq)
	
	
* All remaining sub-groups have only been mention in January 2011 list	
	

* Working Party on Financial Services: Investor Compensation Schemes
* Syst�mes d'indemnisation des investisseurs
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "(INDEM.* INVEST)|(INVEST.* COMP)") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode == "" /*
	*/ & regex(wpname, "(INDEM.* INVEST)|(INVEST.* COMP)")
* All meetings are pre-1999
replace wpcode = "F06yb" if wpcode == "" /*
	*/ & regexm(wpname, "(INDEM.* INVEST)|(INVEST.* COMP)") /*
	*/ & date > d(26nov1999)
*groups wpname if wpcode == "F06yb", order(h) miss
	
*groups wpname if wpcode != "F06yb" & wpcode != "Z00" /*
	*/ & regexm(wpname, "") /*
	*/ , order(h) show(freq Freq)
* No observations
	

* Working Party on Financial Services: Transport Euro Cash
* Transport d'euros en esp�ces
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "EURO") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06yc" if wpcode == "EUROS" /*
	*/ & regexm(wpname, "")
*groups wpname if wpcode == "F06yc", order(h) miss
	
*groups wpname if wpcode != "F06yc" & wpcode != "Z00" /*
	*/ & regexm(wpname, "TRANS.*EURO") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Financial Services: Short Selling
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SHORT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06yd" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SHORT")
*groups wpname if wpcode == "F06yd", order(h) miss
	
**groups wpname if wpcode != "F06yd" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SHORT") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Financial Services: OCT Derivatives
* Produits d�riv�s n�goci�s de gr� � gr�
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "DERIV") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06ye" if wpcode == "" /*
	*/ & regexm(wpname, "DERIV")
*groups wpname if wpcode == "F06ye", order(h) miss
	
*groups wpname if wpcode != "F06ye" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DERIV") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Financial Services: Financial Conglomerates (II)
* Conglom�rats financiers
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "CONGL") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06yf" if wpcode == "" /*
	*/ & regexm(wpname, "CONGL")
*groups wpname if wpcode == "F06yf", order(h) miss
	
*groups wpname if wpcode != "F06yf" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CONGL") /*
	*/ , order(h) show(freq Freq)
*list date wpcode wpname if wpcode != "F06yf" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CONGL")
* No observations, all long before start date of this sub-group


* Working Party on Financial Services: SEPA (Single Euro Payments Area)
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "PAIE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06yg" if wpcode == "SEPA" /*
	*/ & regexm(wpname, "SEPA")
*groups wpname if wpcode == "F06yg", order(h) miss
	
*groups wpname if wpcode != "F06yg" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PAIE") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Financial Services: Omnibus 2
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "OMNI") /*
	*/ , order(h) show(freq Freq)
*replace wpcode = "F06yh" if wpcode == "" /*
	*/ & regexm(wpname, "OMNI")
*groups wpname if wpcode == "F06yh", order(h) miss
	
*groups wpname if wpcode != "F06yh" & wpcode != "Z00" /*
	*/ & regexm(wpname, "OMNI") /*
	*/ , order(h) show(freq Freq)
* No observations

	
* Working Party on Financial Services
* Banking and payment system legislation is pre-1999
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SERV.*FIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F06" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SERV.*FIN")
*groups wpname if wpcode == "F06", order(h) miss

**groups wpname if wpcode != "F06" & regexm(wpcode, "F06") == 0 & & wpcode != "A13" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SERV.*FIN") /*
	*/ , order(h) show(freq Freq)

* Correction
replace wpcode = "F06" if wpname == "ATTACHES SERVICES FINANCIERS (TOPIC MARKET ABUSE REGUL.)"
	
* Working Party on Tax Questions: Indirect Taxation (VAT, Excise Duties, Energy Taxation)
* Before 1999, it seemed to be called 'Financial Questions'
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(FISC.*IND)|(TVA)") /*
	*/ & regex(wpname, " DIR") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F07a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(FISC.*IND)|(TVA)") /*
	*/ & regex(wpname, " DIR") == 0
*groups wpname if wpcode == "F07a", order(h) miss

**groups wpname if wpcode != "F07a" & wpcode != "Z00" /*
	*/ & regex(wpname, "(FISC.*IND)|(TVA)") /*
	*/ & regex(wpname, " DIR") == 0 /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Tax Questions: Direct Taxation (including Taxation of Savings, Interest and Royalties)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((FISC)|(TAX)).* DIR") /*
	*/ & regex(wpname, " IND") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F07b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((FISC)|(TAX)).* DIR") /*
	*/ & regex(wpname, " IND") == 0
*groups wpname if wpcode == "F07b", order(h) miss
		
**groups wpname if wpcode != "F07b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "((FISC)|(TAX)).* DIR") /*
	*/ & regex(wpname, " IND") == 0 /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Tax Questions
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & (regex(wpname, "QU.*FISC") /*
	*/ & regex(wpname, "H\.N\.") == 0) /*
	*/ | regex(wpname, "FISC.*DIR.*IND") /*
	*/ | regex(wpname, "FISC.*IND.*DIR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F07" if wpcode == "" & wpcode != "Z00" /*
	*/ & (regex(wpname, "QU.*FISC") /*
	*/ & regex(wpname, "H\.N\.") == 0) /*
	*/ | regex(wpname, "FISC.*DIR.*IND") /*
	*/ | regex(wpname, "FISC.*IND.*DIR")
*groups wpname if wpcode == "F07", order(h) miss

**groups wpname if wpcode != "F07" & regexm(wpcode, "F07") == 0 & wpcode != "Z00" /*
	*/ & (regex(wpname, "QU.*FISC") /*
	*/ & regex(wpname, "H\.N\.") == 0) /*
	*/ | regex(wpname, "FISC.*DIR.*IND") /*
	*/ | regex(wpname, "FISC.*IND.*DIR") /*
	*/ , order(h) show(freq Freq)

	
* Code of Conduct Group (Business Taxation): Sub-group A
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CODE.*GROUPE A") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F08a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CODE.*GROUPE A")
*groups wpname if wpcode == "F08a", order(h) miss

**groups wpname if wpcode != "F08a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CODE.*GROUPE A") /*
	*/ , order(h) show(freq Freq)

	
* Code of Conduct Group (Business Taxation): Sub-group B
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CODE.*GR.* B") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F08b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CODE.*GR.* B")
*groups wpname if wpcode == "F08b", order(h) miss

**groups wpname if wpcode != "F08b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CODE.*GR.* B") /*
	*/ , order(h) show(freq Freq)
	
	
* Code of Conduct Group (Business Taxation): Sub-Group (Anti-Abuse Issues Related to Inbound and Outbound Profit Transfers and Mismatches Between Tax Systems)	
* Groupe Code de conduite (fiscalit� des entreprises): Sous-Groupe (questions anti-abus li�es aux transferts de b�n�fices en entr�e ou en sortie et incompatibilit�s entre les syst�mes fiscaux)
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "CONDUIT.*SOUS.*GROUPE\)?$") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode == "" /*
	*/ & regex(wpname, "CONDUIT.*SOUS.*GROUPE\)?$")
replace wpcode = "F08c" if wpcode == "" /*
	*/ & regexm(wpname, "CONDUIT.*SOUS.*GROUPE\)?$")
*groups wpname if wpcode == "F08c", order(h) miss
	
*groups wpname if wpcode != "F08c" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CONDUIT.*SOUS.*GROUPE\)?$") /*
	*/ , order(h) show(freq Freq)

	
* Code of Conduct Group (Business Taxation)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CODE ") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F08" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CODE ")
*groups wpname if wpcode == "F08", order(h) miss
	
**groups wpname if wpcode != "F08" & regexm(wpcode, "F08") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "CODE ") /*
	*/ , order(h) show(freq Freq)

* Make correction
replace wpcode = "" if wpname == "ROME FAO - COORDINATION MINIST. PECHE (CODE CONDUITE)"

	
* Ad hoc Working party on Tax Fraud
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FRAUDE.*FISC") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F09" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FRAUDE.*FISC")
*groups wpname if wpcode == "F09", order(h) miss
	
**groups wpname if wpcode != "F09" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FRAUDE.*FISC") /*
	*/ , order(h) show(freq Freq)

	
* High Level Working Party on Taxation
* Tricky distinction between those two high-level *groups

	
* High Level Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regexm(wpname, "((H\.N\.)|(HAUT)).*((FISC)|(FIN))") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F11" if wpcode == "" & wpcode != "Z00" /*
	*/ & regexm(wpname, "((H\.N\.)|(HAUT)).*((FISC)|(FIN))")
*groups wpname if wpcode == "F11", order(h) miss

**groups wpname if wpcode != "F11" & wpcode != "Z00" /*
	*/ & regex(wpname, "((H\.N\.)|(HAUT)).*FISC") /*
	*/ , order(h) show(freq Freq)

* Make correction
replace wpcode = "" if wpname == "H.N. FISCALITE - TAXATION ENERGIE"
	
	
* Ad hoc High Level Working Party on Energy Taxation
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TAXA.*ENER") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F12" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TAXA.*ENER")
*groups wpname if wpcode == "F12", order(h) miss

**groups wpname if wpcode != "F12" & wpcode != "F02" & wpcode != "F07a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "TAXA.*ENER") /*
	*/ , order(h) show(freq Freq)

	
* Ad hoc Working Party on the Stability Pact
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PACT.*STAB") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F13" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PACT.*STAB")
*groups wpname if wpcode == "F13", order(h) miss
	
*groups wpname if wpcode != "F13" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PACT.*STAB") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "F13" if wpcode != "F13" & wpcode != "C04" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "PACT.*STAB")

* Make correction
replace wpcode = "" if wpname == "CONJOINT EXPERTS CIREFI + PAYS PACTE DE STABILITE"
replace wpcode = "" if wpname == "PACTE DE STABILITE - TABLE REGIONAL"

	
* Working Party on Own Resources
* Note: There is also a sub-group of WP on Financial Questions on this topic
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RESS.*PROPR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F14" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RESS.*PROPR")
*groups wpname if wpcode == "F14", order(h) miss
	
**groups wpname if wpcode != "F14" & wpcode != "F02a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "RESS.*PROPR") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Insurance
* (moved from K06 and coded as such; code corrected as part of cross-validation with lifecycle data
* F15
	
	
* Export Credits Group
* (moved from C34 and coded as such; code corrected as part of cross-validation with lifecycle data
* F16
	
	
* Ad hoc Working Party on Economic Governance
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GOUVER.*ECO") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F17" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GOUVER.*ECO")
*groups wpname if wpcode == "F17", order(h) miss
	
**groups wpname if wpcode != "F17" & wpcode != "Z00" /*
	*/ & regex(wpname, "GOUVER.*ECO") /*
	*/ , order(h) show(freq Freq)
	
	
**
* Ad hoc Working Party on the Banking Supervision Mechanism
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(SURVEILL.*BANC)|(BANK SUPERV)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F18" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(SURVEILL.*BANC)|(BANK SUPERV)")
*groups wpname if wpcode == "F18", order(h) miss
	
**groups wpname if wpcode != "F18" & wpcode != "Z00" /*
	*/ & regex(wpname, "(SURVEILL.*BANC)|(BANK SUPERV)") /*
	*/ , order(h) show(freq Freq)
* No observations!

	
**
* Ad hoc Working Party on the Single Resolution Mechanism
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(((BANK)|(SINGLE)).*RES)|(SRM)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F19" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(((BANK)|(SINGLE)).*RES)|(SRM)")
*groups wpname if wpcode == "F19", order(h) miss
	
*groups wpname if wpcode != "F19" & wpcode != "Z00" /*
	*/ & regex(wpname, "(((BANK)|(SINGLE)).*RES)|(SRM)") /*
	*/ , order(h) show(freq Freq)
	
	
* Bank legislation (pre-1999)
list date wpname if regex(wpname, "BANK") 	
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BANC") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BANC")
*groups wpname if wpcode == "F00", order(h) miss
	
	
* Payment systems (pre-1999)
list date wpname if regex(wpname, "SYS.*PAIE") 	
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SYS.*PAIE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SYS.*PAIE")
*groups wpname if wpcode == "F00", order(h) miss
		
		
* WP on Cross-Border Credit-Transfers
list date wpname if regex(wpname, "VIR.*TRANS.*") 	
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VIR.*TRANS.*") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VIR.*TRANS.*")
*groups wpname if wpcode == "F00", order(h) miss


* WP on Investor Compensation Schemes
list date wpname if regex(wpname, "IND.*INV.*") 	
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "IND.*INV.*") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "IND.*INV.*")
*groups wpname if wpcode == "F00", order(h) miss


* WP on Refinancing/Recapitalisation of Banks
list date wpname if regex(wpname, "BANQUES") 	
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BANQUES") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BANQUES")
*groups wpname if wpcode == "", order(h) miss


* Attaches
list date wpname if regex(wpname, "((ATT)|(CONS)).*FISC") 	
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((ATT)|(CONS)).*FISC") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((ATT)|(CONS)).*FISC")
*groups wpname if wpcode == "F00", order(h) miss show(freq Freq)

* Make correction
replace wpcode = "F07a" if wpcode == "F00" & regexm(wpname, "ACCISES")


* Justice and Home Affairs
**************************

* Strategic Committee on Immigration, Frontiers and Asylum (SCIFA)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(S\.?C\.?I\.?F\.?A\.?)|(COMITE STRAT)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(S\.?C\.?I\.?F\.?A\.?)|(COMITE STRAT)")
*groups wpname if wpcode == "G01", order(h) miss

*groups wpname if wpcode != "G01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(S\.?C\.?I\.?F\.?A\.?)|(COMITE STRAT)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G01" if wpcode != "G01" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(S\.?C\.?I\.?F\.?A\.?)|(COMITE STRAT)")
*groups wpname if wpcode2 == "G01", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "G01" & wpcode2 != "G01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(S\.?C\.?I\.?F\.?A\.?)|(COMITE STRAT)") /*
	*/ , order(h) show(freq Freq)

* Make corrections
replace wpcode = "G01" if wpname == "CT STRAT. SUR L'IMMIGRATION, FRONTIERES ET L'ASILE"


* Working Party on Integration, Migration and Expulsion
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(MIGR)|(ELOIGN)|(EXPUL)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G02" if  wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(MIGR)|(ELOIGN)|(EXPUL)")
*groups wpname if wpcode == "G02", order(h) miss
	
*groups wpname if wpcode != "G02" & wpcode != "B03" & wpcode != "G01" & wpcode != "C49" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(MIGR)|(ELOIGN)|(EXPUL)") /*
	*/ , order(h) show(freq Freq)
* Replace only observation that corresponds to working party
replace wpcode2 = "G02" if wpcode != "G02" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "^MIGR")
*groups wpname if wpcode2 == "G02", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "G02" & wpcode2 != "G02" & wpcode != "B03" & wpcode != "G01" & wpcode != "C49" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(MIGR)|(ELOIGN)|(EXPUL)") /*
	*/ , order(h) show(freq Freq)

* Make corrections
replace wpcode = "Z00" if regexm(wpname, "UE - LAC")	
replace wpcode = "Z00" if wpname == "REUNION UE - MAROC (MIGRATION)"		
replace wpcode = "Z00" if wpname == "REUNION UE - MAROC (MIGRATION)"		

	
* Visa Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VISA") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VISA")
*groups wpname if wpcode == "G03", order(h) miss

*groups wpname if wpcode != "G03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "VISA") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G03" if wpcode != "G03" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "VISA")
*groups wpname if wpcode2 == "G03", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "G03" & wpcode2 != "G03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "VISA") /*
	*/ , order(h) show(freq Freq)
	

* Asylum Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(ASILE)|(ASYLUM)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G04" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(ASILE)|(ASYLUM)")
*groups wpname if wpcode == "G04", order(h) miss

*groups wpname if wpcode != "G04" & wpcode != "B03" & wpcode != "G01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(ASILE)|(ASYLUM)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G04" if wpcode != "G04" & wpcode != "B03" & wpcode != "G01" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(ASILE)|(ASYLUM)")
*groups wpname if wpcode2 == "G04", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "G04" & wpcode2 != "G04" & wpcode != "B03" & wpcode != "G01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "((ASILE)|(ASYLUM)") /*
	*/ , order(h) show(freq Freq)
	

* Asylum Working Party: Dublin Convention
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, " DUBLIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G04a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, " DUBLIN")
*groups wpname if wpcode == "G04a", order(h) miss

**groups wpname if wpcode != "G04a" & wpcode != "Z00" /*
	*/ & regexm(wpname, " DUBLIN") /*
	*/ , order(h) show(freq Freq)
	

* Asylum Working Party: Eurodac
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(EURODAC)|(Eurodac)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G04b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(EURODAC)|(Eurodac)")
*groups wpname if wpcode == "G04b", order(h) miss

**groups wpname if wpcode != "G04b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(EURODAC)|(Eurodac)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G04b" if wpcode != "G04b" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(EURODAC)|(Eurodac)")
	

* Centre for Information, Discussion and Exchange on Asylum (CIREA) Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CIREA") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G05" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CIREA")
*groups wpname if wpcode == "G05", order(h) miss

*groups wpname if wpcode != "G05" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CIREA") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G05" if wpcode != "G05" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "CIREA")
*groups wpname if wpcode2 == "G05", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "G05" & wpcode2 != "G05" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CIREA") /*
	*/ , order(h) show(freq Freq)
	

* Centre for Information, Discussion and Exchange on the Crossing of Borders and Immigration (CIREFI) Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CIREFI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G06" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CIREFI")
*groups wpname if wpcode == "G06", order(h) miss

*groups wpname if wpcode != "G06" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CIREFI") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G06" if wpcode != "G06" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "CIREFI")
*groups wpname if wpcode2 == "G06", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "G06" & wpcode2 != "G06" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CIREFI") /*
	*/ , order(h) show(freq Freq)
replace wpcode3 = "G06" if wpcode != "G06" & wpcode2 != "G06" & wpcode != "Z00" & wpcode3 == "" /*
	*/ & regexm(wpname, "CIREFI")
*groups wpname if wpcode3 == "G06", order(h) miss show(freq Freq)		


* Working Party on Frontiers (including false documents)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(FADO)|(FRONTI)|(FAUX)|(BORDER)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G07" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(FADO)|(FRONTI)|(FAUX)|(BORDER)")
*groups wpname if wpcode == "G07", order(h) miss

*groups wpname if wpcode != "G07" & wpcode != "G01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(FADO)|(FRONTI)|(FAUX)|(BORDER)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G07" if wpcode != "G07" & wpcode != "G01" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(FADO)|(FRONTI)|(FAUX)|(BORDER)")
*groups wpname if wpcode2 == "G07", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "G07" & wpcode2 != "G07" & wpcode != "G01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(FADO)|(FRONTI)|(FAUX)|(BORDER)") /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode = "" if wpname == "AUDIOVISUEL (TELEVISION SANS FRONTIERES)"


* Working Party on Civil Law Matters
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DR.*CIV") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G08" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DR.*CIV")
*groups wpname if wpcode == "G08", order(h) miss

**groups wpname if wpcode != "G08" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DR.*CIV") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Information Systems and Data Protection (excl. SIS)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SYS.*PROT.*DONN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G09" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SYS.*PROT.*DONN")
*groups wpname if wpcode == "G09", order(h) miss

**groups wpname if wpcode != "G09" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SYS.*PROT.*DONN") /*
	*/ , order(h) show(freq Freq)
	

* SIS Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & (regex(wpname, "[\( ]SIS") /*
	*/ | regex(wpname, "^SIS") /*
	*/ | regex(wpname, "SYSTEME D'INFORM.")) /*
	*/ & regex(wpname, "TECH") == 0 /*
	*/ & regex(wpname, "SIRENE") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G10" if wpcode == "" & wpcode != "Z00" /*
	*/ & (regex(wpname, "[\( ]SIS") /*
	*/ | regex(wpname, "^SIS") /*
	*/ | regex(wpname, "SYSTEME D'INFORM.")) /*
	*/ & regex(wpname, "TECH") == 0 /*
	*/ & regex(wpname, "SIRENE") == 0
*groups wpname if wpcode == "G10", order(h) miss

**groups wpname if wpcode != "G10" & wpcode != "Z00" /*
	*/ & (regex(wpname, "[\( ]SIS") /*
	*/ | regex(wpname, "^SIS") /*
	*/ | regex(wpname, "SYSTEME D'INFORM.")) /*
	*/ & regex(wpname, "TECH") == 0 /*
	*/ & regex(wpname, "SIRENE") == 0 /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode = "Z00" if wpname == "WORKSHOP SIS"


* SIS-TECH Working Party: General
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "S[IY]S.*TECH")/*
	*/ & regex(wpname, "GENERAL") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G11a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "S[IY]S.*TECH") /*
	*/ & regex(wpname, "GENERAL")
*groups wpname if wpcode == "G11a", order(h) miss

**groups wpname if wpcode != "G11a" & wpcode != "Z00" /*
	*/ & regex(wpname, "S[IY]S.*TECH") /*
	*/ & regex(wpname, "GENERAL") /*
	*/ , order(h) show(freq Freq)
	

* SIS-TECH Working Party: SISNET
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "S[IY]S.*TECH")/*
	*/ & regex(wpname, "SISNET") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G11b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "S[IY]S.*TECH") /*
	*/ & regex(wpname, "SISNET")
*groups wpname if wpcode == "G11b", order(h) miss

**groups wpname if wpcode != "G11b" & wpcode != "Z00" /*
	*/ & regex(wpname, "S[IY]S.*TECH") /*
	*/ & regex(wpname, "SISNET") /*
	*/ , order(h) show(freq Freq)

	
* SIS-TECH Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & (regex(wpname, "S[IY]S.*TECH") /*
	*/ | regex(wpname, "SYS.*TECH")) /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G11" if wpcode == "" & wpcode != "Z00" /*
	*/ & (regex(wpname, "S[IY]S.*TECH") /*
	*/ | regex(wpname, "SYS.*TECH"))
*groups wpname if wpcode == "G11", order(h) miss

**groups wpname if wpcode != "G11" & regexm(wpcode, "G11") == 0 & wpcode != "Z00" /*
	*/ & (regex(wpname, "S[IY]S.*TECH") /*
	*/ | regex(wpname, "SYS.*TECH")) /*
	*/ , order(h) show(freq Freq)


* SIRENE Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SIRENE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G12" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SIRENE")
*groups wpname if wpcode == "G12", order(h) miss

**groups wpname if wpcode != "G12" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SIRENE") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Police Cooperation (including false documents)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COOP.*POL") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G13" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COOP.*POL")
*groups wpname if wpcode == "G13", order(h) miss

*groups wpname if wpcode != "G13" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COOP.*POLIC") /*
	*/ , order(h) show(freq Freq)	
	

* Working Party on Police Cooperation (including false documents): Telecommunication
* Coop�ration polici�re (y compris falsification de documents): t�l�communications
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COOP.*POL") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G13a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COOP.*POL.*TELECOMM")
*groups wpname if wpcode == "G13a", order(h) miss

*groups wpname if wpcode != "G13a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COOP.*POLIC") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Police Cooperation (including false documents): Investigative Techniques and Forensic Science
* Coop�ration polici�re (y compris falsification de documents): techniques d�investigation et police scientifique
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(INVESTIG)|(POL.* SCI)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G13b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(INVESTIG)|(POL.* SCI)")
*groups wpname if wpcode == "G13b", order(h) miss

**groups wpname if wpcode != "G13b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(INVESTIG)|(POL.* SCI)") /*
	*/ , order(h) show(freq Freq)


* Working Party on Police Cooperation (including false documents): Exchange of Police Intelligence
* Coop�ration polici�re (y compris falsification de documents): �change de renseignements
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RENS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G13c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ECH.*RENS")
*groups wpname if wpcode == "G13c", order(h) miss

*groups wpname if wpcode != "G13c" & wpcode != "Z00" /*
	*/ & regexm(wpname, "RENS") /*
	*/ , order(h) show(freq Freq)	
* no observations
	
	
* Europol Working Party
* (without Joint Supervision Board, Appeals Committee, or Joint Supervision Authority of Schengen
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EUROPOL") /*
	*/ & regex(wpname, "(J ?S ?B)|(APPEA?L)|(JSA)|(AUT.*CONTR.*COMMUN)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G14" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EUROPOL") /*
	*/ & regex(wpname, "(J ?S ?B)|(APPEA?L)|(JSA)|(AUT.*CONTR.*COMMUN)") == 0
*groups wpname if wpcode == "G14", order(h) miss

*groups wpname if wpcode != "G14" & wpcode != "Z00" /*
	*/ & regex(wpname, "EUROPOL") /*
	*/ & regex(wpname, "(J ?S ?B)|(APPEA?L)|(JSA)|(AUT.*CONTR.*COMMUN)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G14" if wpcode != "G14" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "EUROPOL") /*
	*/ & regex(wpname, "(J ?S ?B)|(APPEA?L)|(JSA)|(AUT.*CONTR.*COMMUN)") == 0
*groups wpname if wpcode2 == "G14", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "G14" & wpcode2 != "G14" & wpcode != "Z00" /*
	*/ & regex(wpname, "EUROPOL") /*
	*/ & regex(wpname, "(J ?S ?B)|(APPEA?L)|(JSA)|(AUT.*CONTR.*COMMUN)") == 0 /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Terrorism
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TERROR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G15" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TERROR")
*groups wpname if wpcode == "G15", order(h) miss

*groups wpname if wpcode != "G15" & wpcode != "Z00" /*
	*/ & regexm(wpname, "TERROR") /*
	*/ & (regexm(wpname, "(PESC)|(COTER)|(ASP.*INT)") == 0 | regexm(wpname, "CONJOINT")) /*
	*/ & (regexm(wpname, "EURO( - )?MED") == 0) /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G15" if wpcode != "G15" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "TERROR") /*
	*/ & (regexm(wpname, "(PESC)|(COTER)|(ASP.*INT)") == 0 | regexm(wpname, "CONJOINT")) /*
	*/ & (regexm(wpname, "EURO( - )?MED") == 0)
*groups wpname if wpcode2 == "G15", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "G15" & wpcode2 != "G15" & wpcode != "Z00" /*
	*/ & regexm(wpname, "TERROR") /*
	*/ & (regexm(wpname, "(PESC)|(COTER)|(ASP.*INT)") == 0 | regexm(wpname, "CONJOINT")) /*
	*/ & (regexm(wpname, "EURO( - )?MED") == 0) /*
	*/ , order(h) show(freq Freq)

replace wpcode3 = "G15" if wpcode != "G15" & wpcode2 != "G15" & wpcode != "Z00" & wpcode3 == "" /*
	*/ & regexm(wpname, "TERROR") /*
	*/ & (regexm(wpname, "(PESC)|(COTER)|(ASP.*INT)") == 0 | regexm(wpname, "CONJOINT")) /*
	*/ & (regexm(wpname, "EURO( - )?MED") == 0)
*groups wpname if wpcode3 == "G15", order(h) miss show(freq Freq)	
	
* Make corrections
replace wpcode2 = "G15" if wpname == "TERRORISME / COTER"
replace wpcode2 = "" if wpname == "CONJOINT COTER / TERRORISME (ASPECTS INTERN.)"
replace wpcode2 = "" if wpname == "AMIS DE LA PRESIDENCE - BIO - TERRORISME"
replace wpcode2 = "" if wpname == "TERRORISME 2EME PILIER"


* Working Party on Drug Trafficking
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TRAFIC") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G16" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TRAFIC")
*groups wpname if wpcode == "G16", order(h) miss

**groups wpname if wpcode != "G16" & wpcode != "Z00" /*
	*/ & regexm(wpname, "TRAFIC") /*
	*/ , order(h) show(freq Freq)


* Customs Cooperation Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((COOP)|(CONS)|(ATT)).*DOUAN") /*
	*/ & regex(wpname, "(POLIT)|(COMM)|(UNION)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G17" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((COOP)|(CONS)|(ATT)).*DOUAN") /*
	*/ & regex(wpname, "(POLIT)|(COMM)|(UNION)") == 0
*groups wpname if wpcode == "G17", order(h) miss

*groups wpname if wpcode != "G17" & wpcode != "Z00" /*
	*/ & regex(wpname, "((COOP)|(CONS)|(ATT)).*DOUAN") /*
	*/ & regex(wpname, "(POLIT)|(COMM)|(UNION)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G17" if wpcode != "G17" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "((COOP)|(CONS)|(ATT)).*DOUAN") /*
	*/ & regex(wpname, "(POLIT)|(COMM)|(UNION)") == 0
*groups wpname if wpcode2 == "G17", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "G17" & wpcode2 != "G17" & wpcode != "Z00" /*
	*/ & regex(wpname, "((COOP)|(CONS)|(ATT)).*DOUAN") /*
	*/ & regex(wpname, "(POLIT)|(COMM)|(UNION)") == 0 /*
	*/ , order(h) show(freq Freq)

* Make corrections
replace wpcode = "G17" if wpname == "DOUANES - ATTACHES"
replace wpcode = "G17" if wpname == "CUSTOMS ATTACHES"
replace wpcode = "G17" if wpname == "CONJOINT LEGISLATION ET POLITIQUE DOUANIERES + COOPERATION DOUANIERE"


* Working Party on Cooperation in Criminal Matters
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COOP.*JUD)|(MAT.*PEN)|(\(COPEN\))") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G18" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COOP.*JUD)|(MAT.*PEN)|(\(COPEN\))")
*groups wpname if wpcode == "G18", order(h) miss

*groups wpname if wpcode != "G18" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COOP.*JUD)|(MAT.*PEN)|(\(COPEN\))") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G18" if wpcode != "G18" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(COOP.*JUD)|(MAT.*PEN)|(\(COPEN\))")
*groups wpname if wpcode2 == "G18", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "G18" & wpcode2 != "G18" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COOP.*JUD)|(MAT.*PEN)|(\(COPEN\))") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Substantive Criminal Law
* Deals also with EUROJUST (temporal pattern is also quite clear)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(DR.*PEN)|(PEN.*MAT)|(EUROJUST)|(DROIPEN)") /*
	*/ & regex(wpname, "(DR.*COMM)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G19" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(DR.*PEN)|(PEN.*MAT)|(EUROJUST)|(DROIPEN)") /*
	*/ & regex(wpname, "(DR.*COMM)") == 0
*groups wpname if wpcode == "G19", order(h) miss

*groups wpname if wpcode != "G19" & wpcode != "Z00" /*
	*/ & regex(wpname, "(DR.*PEN)(PEN.*MAT)|(EUROJUST)|(DROIPEN)") /*
	*/ & regex(wpname, "(DR.*COMM)") == 0 /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Collective Evaluation
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EVAL") /*
	*/ & regex(wpname, "SCHENGEN") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G20" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GROUPE EVALUATION COLLECTIVE")
*groups wpname if wpcode == "G20", order(h) miss
	
**groups wpname if wpcode != "G20" & wpcode != "Z00" /*
	*/ & regexm(wpname, "GROUPE EVALUATION COLLECTIVE") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Schengen Evaluation
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(EVAL.*SCHENG)|(SCHENG.*EVAL)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G21" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(EVAL.*SCHENG)|(SCHENG.*EVAL)")
*groups wpname if wpcode == "G21", order(h) miss

**groups wpname if wpcode != "G21" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(EVAL.*SCHENG)|(SCHENG.*EVAL)") /*
	*/ , order(h) show(freq Freq)

	
* Code Schengen Joint Suoervision Authority
*groups wpname if regexm(wpname, "(AUT.*CONT.*COMM)|(JSA)|(A\.C\.C\.)")
replace wpcode = "Z00" if regexm(wpname, "(AUT.*CONT.*COMM)|(JSA)|(A\.C\.C\.)")
	

* Working Party on the Schengen Acquis
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SCHENG") /*
	*/ , order(h) show(freq Freq)	
replace wpcode = "G22" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SCHENG")
*groups wpname if wpcode == "G22", order(h) miss

*groups wpname if wpcode != "G22" & wpcode != "G10" & regexm(wpcode, "G11") == 0 /*
	*/ & wpcode != "G12" & wpcode != "G21" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SCHENG") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G22" if wpcode != "G22" & wpcode != "G10" & regexm(wpcode, "G11") == 0 /*
	*/ & wpcode != "G12" & wpcode != "G21" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SCHENG")
*groups wpname if wpcode2 == "G22", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "G22" & wpcode != "G10" & regexm(wpcode, "G11") == 0 /*
	*/ & wpcode != "G12" & wpcode != "G21" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SCHENG") /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode2 = "" if regexm(wpname, "CONSEILLERS JAI \+ ANTICI : SCHENGEN")
	

* Working Party on the European Judicial Network
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RES.*JUD.*EUR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G24" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RES.*JUD.*EUR")
*groups wpname if wpcode == "G24", order(h) miss

**groups wpname if wpcode != "G24" & wpcode != "Z00" /*
	*/ & regexm(wpname, "RES.*JUD.*EUR") /*
	*/ , order(h) show(freq Freq)

replace wpcode2 = "G24" if wpname == "CONJOINT COOPERATION EN MATIERE PENALE / EJN EUROPEAN JUDICIAL NETWORK"


* Working Party on the Contact and Support Network
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(RES.*CONTACT)|(CONT.*SUPP)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G25" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(RES.*CONTACT)|(CONT.*SUPP)")
*groups wpname if wpcode == "G25", order(h) miss

**groups wpname if wpcode != "G25" & wpcode != "Z00" /*
	*/ & regexm(wpname, "RES.*CONTACT") /*
	*/ , order(h) show(freq Freq)

	
* Multidisciplinary Group on Organised Crime (including Pre-accession Pact Experts Group PAPEG)
* Organised Crime Working Party existed before 1999
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CRIM.*ORG)|(MDG)|(^GMD)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G23" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CRIM.*ORG)|(MDG)|(^GMD)")
*groups wpname if wpcode == "G23", order(h) miss
	
*groups wpname if wpcode != "G23" & wpcode != "G24" & wpcode != "G25" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CRIM.*ORG)|(MDG)|(^GMD)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G23" if wpcode != "G23" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(CRIM.*ORG)|(MDG)|(^GMD)")
*groups wpname if wpcode2 == "G23", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "G23" & wpcode2 != "G23" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CRIM.*ORG)|(MDG)|(^GMD)") /*
	*/ , order(h) show(freq Freq)
	
replace wpcode2 = "G23" if wpname == "COOPERATION POLICIERE + CONJOINT COOPERATION POL. / GMD"

	
* Working Party on Civil Protection
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROT.*CIV") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G26" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROT.*CIV")
*groups wpname if wpcode == "G26", order(h) miss

*groups wpname if wpcode != "G26" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PROT.*CIV") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G26" if wpcode != "G26" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "PROT.*CIV")
*groups wpname if wpcode2 == "G26", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "G26" & wpcode2 != "G26" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PROT.*CIV") /*
	*/ , order(h) show(freq Freq)
	

* SIS/SIRENE Working Party


* Ad hoc Working Party on Fundamental Rights and Citizenship
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AD HOC DR.*FOND.*CIT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G28" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AD HOC DR.*FOND.*CIT")
*groups wpname if wpcode == "G28", order(h) miss
	
**groups wpname if wpcode != "G28" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AD HOC DR.*FOND.*CIT") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Information Exchange and Data Protection
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DONNE.*INFO") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G29" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DONNE.*INFO")
*groups wpname if wpcode == "G29", order(h) miss
	
**groups wpname if wpcode != "G29" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DONNE.*INFO") /*
	*/ , order(h) show(freq Freq)
	
	
* JAI-RELEX Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(REL.*EX.*JAI)|(JAI.*REL.*EX)|(JAIEX)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G30" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(REL.*EX.*JAI)|(JAI.*REL.*EX)|(JAIEX)")
*groups wpname if wpcode == "G30", order(h) miss

**groups wpname if wpcode != "G30" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(REL.*EX.*JAI)|(JAI.*REL.*EX)|(JAIEX)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Fundamental Rights, Citizens Rights and Free Movement of Persons
* All others are FR Convention meetings
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DR.*FOND.*CIT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G31" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DR.*FOND.*CIT")
*groups wpname if wpcode == "G31", order(h) miss
	
**groups wpname if wpcode != "G31" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DR.*FOND.*CIT") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Schengen Matters	
	
	
* Law Enforcement Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(APPL.*LOI)|(LAW ENF)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G33" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(APPL.*LOI)|(LAW ENF)")
*groups wpname if wpcode == "G33", order(h) miss

*groups wpname if wpcode != "G33" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(APPL.*LOI)|(LAW ENF)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "G33" if wpcode != "G33" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(APPL.*LOI)|(LAW ENF)")
*groups wpname if wpcode2 == "G33", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "G33" & wpcode2 != "G33" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(APPL.*LOI)|(LAW ENF)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on General Matters including Evaluation
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(QUEST.*GEN.*EVAL)|(GEN.*MATT.*EVAL)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G34" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(QUEST.*GEN.*EVAL)|(GEN.*MATT.*EVAL)")
*groups wpname if wpcode == "G34", order(h) miss

**groups wpname if wpcode != "G34" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(QUEST.*GEN.*EVAL)|(GEN.*MATT.*EVAL)") /*
	*/ , order(h) show(freq Freq)


* Ad hoc Group on Information Exchange
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(ECH.*INF)|(INF.*EXCH)") /*
	*/ & regex(wpname, "PROT.*DONN") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G35" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(ECH.*INF)|(INF.*EXCH)") /*
	*/ & regex(wpname, "PROT.*DONN") == 0
*groups wpname if wpcode == "G35", order(h) miss

**groups wpname if wpcode != "G35" & wpcode != "Z00" /*
	*/ & regex(wpname, "(ECH.*INF)|(INF.*EXCH)") /*
	*/ & regex(wpname, "PROT.*DONN") == 0 /*
	*/ , order(h) show(freq Freq)
	
**
* Ad hoc Working Party JHA Financial Instruments
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(INST.* FIN)|(FIN.* INST)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G36" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(INST.* FIN)|(FIN.* INST)")
*groups wpname if wpcode == "G36", order(h) miss

*groups wpname if wpcode != "G36" & wpcode != "Z00" /*
	*/ & regex(wpname, "(INST.* FIN)|(FIN.* INST)") /*
	*/ , order(h) show(freq Freq)
* No observations

		
* JAI Counsellors
* Not officially a separate working party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((ATT)|(CONS)).*JAI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G37" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((ATT)|(CONS)).*JAI")
*groups wpname if wpcode == "G37", order(h) miss

*groups wpname if wpcode != "G37" & wpcode != "Z00" /*
	*/ & regex(wpname, "((ATT)|(CONS)).*JAI") /*
	*/ & regex(wpname, "(CONJ)|(\+)") /*
	*/ , order(h) show(freq Freq)	
replace wpcode2 = "G37" if wpcode != "G37" & wpcode != "Z00" /*
	*/ & regex(wpname, "((ATT)|(CONS)).*JAI") /*
	*/ & regex(wpname, "(CONJ)|(\+)")
*groups wpname if wpcode2 == "G37", order(h) miss
	
* Make corrections
replace wpcode = "Z00" if regexm(wpname, "COMITE ART\. 18 CONVENT\. DUBLIN \(A L'ISSUE CONSEIL JAI\)")
replace wpcode = "G19" if wpname == "CONSEILLERS JAI (JUSTICE PENALE)"
replace wpcode = "G08" if wpname == "CONSEILLERS JAI (JUSTICE CIVILE)"
replace wpcode2 = "G37" if wpname == "REGION DES BALKANS OCCIDENTAUX / CONSEILLERS JAI"
replace wpcode2 = "G37" if wpname == "CONSEILLERS JAI / ATTACHES FINANCIERS"
replace wpcode = "G37" if wpname == "CONSEILLERS JUSTICE ET AFFAIRES INTERIEURES"


* Friends of visa information system (VIS)
* (this is a working group in JHA dealing with the implementation of the VIS, but on an informal basis)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS DU VIS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G38" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS DU VIS")
*groups wpname if wpcode == "G38", order(h) miss

*groups wpname if wpcode != "G38" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS DU VIS")/*
	*/ , order(h) show(freq Freq)	


* Pre-1999 working parties
**************************

* Criminal and Community Law (pre-1999 working party)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DR.*PEN.*DR.*COMM") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode != "Z00" /*
	*/ & regex(wpname, "DR.*PEN.*DR.*COMM")
replace wpcode = "G00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DR.*PEN.*DR.*COMM")
*groups wpname if wpcode == "G00", order(h) miss


* Directors III (Judicial Cooperation)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GR.*DIR.*III") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode != "Z00" /*
	*/ & regexm(wpname, "GR.*DIR.*III")
replace wpcode = "G00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GR.*DIR.*III")
*groups wpname if wpcode == "G00", order(h) miss


* Directors III (Police Cooperation)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GR.*DIR.*II") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode != "Z00" /*
	*/ & regexm(wpname, "GR.*DIR.*II")
replace wpcode = "G00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GR.*DIR.*II")
*groups wpname if wpcode == "G00", order(h) miss


* Directors III (Asylum and Migration)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GR.*DIR.*I$") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode != "Z00" /*
	*/ & regexm(wpname, "GR.*DIR.*I$")
replace wpcode = "G00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GR.*DIR.*I$")
*groups wpname if wpcode == "G00", order(h) miss
	

* Extradition
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EXTRAD") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode != "Z00" /*
	*/ & regexm(wpname, "EXTRAD")
replace wpcode = "G00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EXTRAD")
*groups wpname if wpcode == "G00", order(h) miss


* Driving License (part of Criminal Law Matters)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DR.*COND") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode != "Z00" /*
	*/ & regexm(wpname, "DR.*COND")
replace wpcode = "G00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DR.*COND")
*groups wpname if wpcode == "G00", order(h) miss


* Simplification of Service of Documents (part of Civil Law matters)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SIMPL.*TRANS") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode != "Z00" /*
	*/ & regexm(wpname, "SIMPL.*TRANS")
replace wpcode = "G00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SIMPL.*TRANS")
*groups wpname if wpcode == "G00", order(h) miss


* Racism and Xenophobia (part of Criminal Law matters)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(RACIS)|(XENO)") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(RACIS)|(XENO)")
replace wpcode = "G00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(RACIS)|(XENO)")
*groups wpname if wpcode == "G00", order(h) miss
	
* Make correction
replace wpcode = "Z00" if wpname == "CONFERENCE MONDIALE CONTRE LE RACISME"


* European Arrest Warrant
* TITRE EXECUTOIRE EUROPEEN
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TITRE EXECUTOIRE") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TITRE EXECUTOIRE")
replace wpcode = "G00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TITRE EXECUTOIRE")
*groups wpname if wpcode == "G00", order(h) miss
	
* Make correction
replace wpcode = "G08" if wpname == "COMITE DROIT CIVIL - TITRE EXECUTOIRE EUROPEEN"


* Other Justice and Home affairs meetings
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "JAI") /*
	*/ & regex(wpname, "CONF") == 0 /*
	*/ , order(h) show(freq Freq)
*list date wpname if  wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "JAI") /*
	*/ & regex(wpname, "CONF") == 0
replace wpcode = "G00" if  wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "JAI") /*
	*/ & regex(wpname, "CONF") == 0
*groups wpname if wpcode == "G00", order(h) miss

	
* Agriculture
*************

* Working Party on the Aegean Sea Islands
* Iles de la mer Eg�e
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EGEE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MER EGEE") & date < d(30oct2001)
*groups wpname if wpcode == "H01", order(h) miss

*groups wpname if wpcode != "H01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MER EG") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode != "H01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MER EG")
* Both meetings are meetings of successor working party
* No observations
	
	
* Working Party on Agricultural Statistics
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "STAT.*AGRI") /*
	*/ & regex(wpname, "COORD.*OCDE") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "STAT.*AGRI") /*
	*/ & regex(wpname, "COORD.*OCDE") == 0
*groups wpname if wpcode == "H02", order(h) miss

**groups wpname if wpcode != "H02" & wpcode != "Z00" /*
	*/ & regex(wpname, "STAT.*AGRI") /*
	*/ & regex(wpname, "COORD.*OCDE") == 0 /*
	*/ , order(h) show(freq Freq)
	
	
* Agricultural Structures Working Party: Agriculture and Environment
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRI.*ENVI") /*
	*/ & regex(wpname, "OCDE") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H03a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRI.*ENVI") /*
	*/ & regex(wpname, "OCDE") == 0
*groups wpname if wpcode == "H03a", order(h) miss

**groups wpname if wpcode != "H03a" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRI.*ENVI") /*
	*/ & regex(wpname, "OCDE") == 0 /*
	*/ , order(h) show(freq Freq)
	
	
* Agricultural Structures Working Party: Rural Development
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DEV.*RUR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H03b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DEV.*RUR")
*groups wpname if wpcode == "H03b", order(h) miss

**groups wpname if wpcode != "H03b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DEV.*RUR") /*
	*/ , order(h) show(freq Freq)

	
* Agricultural Structures Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "STRUCTUR") /*
	*/ & regex(wpname, "COST") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "STRUCTUR") /*
	*/ & regex(wpname, "COST") == 0
*groups wpname if wpcode == "H03", order(h) miss

**groups wpname if wpcode != "H03" & wpcode != "H02" & regexm(wpcode, "H03") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "STRUCTUR") /*
	*/ & regex(wpname, "COST") == 0 /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Genetic Resources in Agriculture
* Ressources g�n�tiques agricoles
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RESS.* G.*") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H04" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RESS.*G.*AGRI")
*groups wpname if wpcode == "H04", order(h) miss

*groups wpname if wpcode != "H04" & wpcode != "Z00" /*
	*/ & regexm(wpname, "RESS.*G.*AGRI") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Genetic Resources in Agriculture: Animals
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "ANIMAUX") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H04a" if wpcode == "GEN.*ANIM" /*
	*/ & regexm(wpname, "")
*groups wpname if wpcode == "H04a", order(h) miss
	
*groups wpname if wpcode != "H04a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ANIMAUX") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Genetic Resources in Agriculture: Plant Products
* L�gumes
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "LEGUME") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H04b" if wpcode == "GEN.*LEGUME" /*
	*/ & regexm(wpname, "")
*groups wpname if wpcode == "H04b", order(h) miss
	
*groups wpname if wpcode != "H04b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "LEGUME") /*
	*/ , order(h) show(freq Freq)
* No observations	
	

* AGRIFIN Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGR[OI].*FIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H05" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGR[OI].*FIN")
*groups wpname if wpcode == "H05", order(h) miss

**groups wpname if wpcode != "H05" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AGR[OI].*FIN") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Agri-monetary Questions
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRIMONETAIRE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H06" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRIMONETAIRE")
*groups wpname if wpcode == "H06", order(h) miss

**groups wpname if wpcode != "H06" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AGRIMONETAIRE") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Agricultural questions: Labelling of beef products
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BOVINE") /*
	*/ & regex(wpname, "(ETIQUETAGE)|(PROMOTION)|(QUESTIONS AGRI)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H07a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BOVINE") /*
	*/ & regex(wpname, "(ETIQUETAGE)|(PROMOTION)|(QUESTIONS AGRI)")
*groups wpname if wpcode == "H07a", order(h) miss

**groups wpname if wpcode != "H07a" & wpcode != "Z00" /*
	*/ & regex(wpname, "BOVINE") /*
	*/ & regex(wpname, "(ETIQUETAGE)|(QUESTIONS AGRI)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Agricultural questions: Animal Feedingstuffs
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ALIM.*ANIM") /*
	*/ & regex(wpname, "CODEX") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H07b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ALIM.*ANIM") /*
	*/ & regex(wpname, "CODEX") == 0
*groups wpname if wpcode == "H07b", order(h) miss

**groups wpname if wpcode != "H07b" & wpcode != "Z00" /*
	*/ & regex(wpname, "ALIM.*ANIM") /*
	*/ & regex(wpname, "CODEX") == 0 /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode = "Z00" if wpname == "COMITE PERM. ALIMENTS ANIMAUX (COMMISSION)"
	

* Working Party on Agricultural questions: Seeds and Propagating Material
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SEMENCES") /*
	*/ & regex(wpname, "GRANDES CULTURES") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H07c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SEMENCES") /*
	*/ & regex(wpname, "GRANDES CULTURES") == 0
*groups wpname if wpcode == "H07c", order(h) miss

**groups wpname if wpcode != "H07c" & wpcode != "Z00" /*
	*/ & regex(wpname, "SEMENCES") /*
	*/ & regex(wpname, "GRANDES CULTURES") == 0 /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode = "" if wpname == "AGRI - FORETS (SEMENCES)"
	

* Working Party on Agricultural questions: Harmful Organisms
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ORG.*NUISIBLE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H07d" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ORG.*NUISIBLE")
*groups wpname if wpcode == "H07d", order(h) miss

**groups wpname if wpcode != "H07d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ORG.*NUISIBLE") /*
	*/ , order(h) show(freq Freq)
	

*Working Party on Agricultural questions: Pesticide Residues
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RES.*PESTI") /*
	*/ & regex(wpname, "CODEX") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H07e" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RES.*PESTI") /*
	*/ & regex(wpname, "CODEX") == 0
*groups wpname if wpcode == "H07e", order(h) miss

**groups wpname if wpcode != "H07e" & wpcode != "Z00" /*
	*/ & regex(wpname, "RES.*PESTI") /*
	*/ & regex(wpname, "CODEX") == 0 /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Agricultural questions: Pesticides/Plant Protection Products
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PESTI") /*
	*/ & regex(wpname, "(CODEX)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H07f" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PESTI") /*
	*/ & regex(wpname, "(CODEX)") == 0
*groups wpname if wpcode == "H07f", order(h) miss

**groups wpname if wpcode != "H07f" & wpcode != "H07e" & wpcode != "Z00" /*
	*/ & regex(wpname, "PESTI") /*
	*/ & regex(wpname, "(CODEX)") == 0 /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Agricultural questions: Plant Breeder Rights
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OBTENT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H07g" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OBTENT")
*groups wpname if wpcode == "H07g", order(h) miss

**groups wpname if wpcode != "H07g" & wpcode != "Z00" /*
	*/ & regex(wpname, "OBTENT") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Agricultural questions: Labelling of Processed Agricultural Products
* Successor of H07a
	
	
* Working Party on Agricultural questions: Genetically Modified Organisms (GMO)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OGM") /*
	*/ & regex(wpname, "ENVI") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H07i" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OGM") /*
	*/ & regex(wpname, "ENVI") == 0
*groups wpname if wpcode == "H07i", order(h) miss

**groups wpname if wpcode != "H07i" & wpcode != "Z00" /*
	*/ & regex(wpname, "OGM") /*
	*/ & regex(wpname, "ENVI") == 0 /*
	*/ , order(h) show(freq Freq)

* Make corrections
replace wpcode = "H07e" if wpname == "QUESTIONS AGRI (residus pesticides)"
replace wpcode = "H07e" if wpname == "QUESTIONS AGRI (RESIDUS)"
	

* Working Party on Animal Products: Beef and Veal
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BOVINE") /*
	*/ & regex(wpname, "(CRISE)|(AD HOC)|(PROMOTION)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H08a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BOVINE") /*
	*/ & regex(wpname, "(CRISE)|(AD HOC)|(PROMOTION)") == 0
*groups wpname if wpcode == "H08a", order(h) miss

**groups wpname if wpcode != "H08a" & wpcode != "H07a" & wpcode != "Z00" /*
	*/ & regex(wpname, "BOVINE") /*
	*/ & regex(wpname, "(CRISE)|(AD HOC)|(PROMOTION)") == 0 /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Animal Products: Sheepmeat and Goatmeat
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "( OVINE)|(CAPRINE)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H08b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "( OVINE)|(CAPRINE)")
*groups wpname if wpcode == "H08b", order(h) miss

**groups wpname if wpcode != "H08b" & wpcode != "Z00" /*
	*/ & regex(wpname, "( OVINE)|(CAPRINE)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Animal Products: Pigmeat
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PORC") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H08c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PORC")
*groups wpname if wpcode == "H08c", order(h) miss

**groups wpname if wpcode != "H08c" & wpcode != "Z00" /*
	*/ & regex(wpname, "PORC") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Animal Products: Eggs and Poultry
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(OEUF)|(VOLAILLE)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H08d" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(OEUF)|(VOLAILLE)")
*groups wpname if wpcode == "H08d", order(h) miss

**groups wpname if wpcode != "H08d" & wpcode != "Z00" /*
	*/ & regex(wpname, "(OEUF)|(VOLAILLE)") /*
	*/ , order(h) show(freq Freq)


* Working Party on Animal Products: Milk and Milk Products
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "LAIT") /*
	*/ & regex(wpname, "(CODEX)|(OCDE)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H08e" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "LAIT") /*
	*/ & regex(wpname, "(CODEX)|(OCDE)") == 0
*groups wpname if wpcode == "H08e", order(h) miss

**groups wpname if wpcode != "H08e" & wpcode != "Z00" /*
	*/ & regex(wpname, "LAIT") /*
	*/ & regex(wpname, "(CODEX)|(OCDE)") == 0 /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Animal Products: Beekeeping and Honey
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(APICULTURE)|(MIEL)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H08f" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(APICULTURE)|(MIEL)")
*groups wpname if wpcode == "H08f", order(h) miss

**groups wpname if wpcode != "H08f" & wpcode != "Z00" /*
	*/ & regex(wpname, "(APICULTURE)|(MIEL)") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Animal Products
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROD.*ANIM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H08" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROD.*ANIM")
*groups wpname if wpcode == "H08", order(h) miss

**groups wpname if wpcode != "H08" & regexm(wpcode, "H08") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "PROD.*ANIM") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Arable Crops: Cereals
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CEREAL") /*
	*/ & regex(wpname, "OCDE") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H09a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CEREAL") /*
	*/ & regex(wpname, "OCDE") == 0
*groups wpname if wpcode == "H09a", order(h) miss

**groups wpname if wpcode != "H09a" & wpcode != "Z00" /*
	*/ & regex(wpname, "CEREAL") /*
	*/ & regex(wpname, "OCDE") == 0 /*
	*/ , order(h) show(freq Freq)


* Working Party on Arable Crops: Oilseeds
* Ol�agineux
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OLEAGINEUX") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H09b" if wpcode == "OLEAGINEUX" /*
	*/ & regexm(wpname, "")
*groups wpname if wpcode == "H09b", order(h) miss
	
**groups wpname if wpcode != "H09b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "OLEA") /*
	*/ , order(h) show(freq Freq)
* No observations
	

* Working Party on Arable crops: Rice
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GR.*CULT.*RIZ") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H09c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GR.*CULT.*RIZ")
*groups wpname if wpcode == "H09c", order(h) miss

**groups wpname if wpcode != "H09c" & wpcode != "Z00" /*
	*/ & regex(wpname, "GR.*CULT.*RIZ") /*
	*/ , order(h) show(freq Freq)	

	
* Working Party on Arable crops: Protein Crops
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROTEAGINEUX") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H09d" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROTEAGINEUX")
*groups wpname if wpcode == "H09d", order(h) miss

*groups wpname if wpcode != "H09d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PROTEAGINEUX") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Arable crops: Seeds
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GR.*CULT.*SEMENCE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H09e" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GR.*CULT.*SEMENCE")
*groups wpname if wpcode == "H09e", order(h) miss

**groups wpname if wpcode != "H09e" & wpcode != "Z00" /*
	*/ & regexm(wpname, "GR.*CULT.*SEMENCE") /*
	*/ , order(h) show(freq Freq)


* Working Party on Arable crops: Dried Fodder
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FOURRAGE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H09f" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FOURRAGE")
*groups wpname if wpcode == "H09f", order(h) miss

*groups wpname if wpcode != "H09f" & wpcode != "Z00" /*
	*/ & regex(wpname, "FOURRAGE") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Arable Crops
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(GRANDES CULT)|(CULTURES ARABLES)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H09" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(GRANDES CULT)|(CULTURES ARABLES)")
*groups wpname if wpcode == "H09", order(h) miss

**groups wpname if wpcode != "H09" & regexm(wpcode, "H09") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "(GRANDES CULT)|(CULTURES ARABLES)") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Beekeeping and Honey
**groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(APICULTURE)|(MIEL)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Simplification of the CAP
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SIMPL.*((P\.?A\.?C)|(CAP))") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H11" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SIMPL.*((P\.?A\.?C)|(CAP))")
*groups wpname if wpcode == "H11", order(h) miss

*groups wpname if wpcode != "H11" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SIMPL.*((P\.?A\.?C)|(CAP))") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Dried Fodder
* Fourrages s�ch�s
* Replaced by H09f
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "FOURR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H12" if wpcode == "" /*
	*/ & regexm(wpname, "FOURR")
*groups wpname if wpcode == "H12", order(h) miss
	
*groups wpname if wpcode != "H12" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FOURR") /*
	*/ , order(h) show(freq Freq)
* Meeting of successor working party
* No observations
	

* FADN (Farms Accountancy Data Network) Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "( RICA)|(FADN)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H13" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "( RICA)|(FADN)")
*groups wpname if wpcode == "H13", order(h) miss

**groups wpname if wpcode != "H13" & wpcode != "Z00" /*
	*/ & regexm(wpname, "( RICA)|(FADN)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Floriculture
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FLORICULTURE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H14" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FLORICULTURE")
*groups wpname if wpcode == "H14", order(h) miss

**groups wpname if wpcode != "H14" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FLORICULTURE") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Forestry (incl. Commission on Sustainable Development (CSD)/Ad hoc Intergovernmental Forum on Forests (IFF))
* FORETS (Y COMPRIS CDD/AD HOC FIF)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FORET") /*
	*/ & regex(wpname, "(FAO)|(OCDE)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H15" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FORET") /*
	*/ & regex(wpname, "(FAO)|(OCDE)") == 0
*groups wpname if wpcode == "H15", order(h) miss

*groups wpname if wpcode != "H15" & wpcode != "Z00" /*
	*/ & regex(wpname, "FORET") /*
	*/ & regex(wpname, "(FAO)|(OCDE)|(COORD)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "H15" if wpcode != "H15" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "FORET") /*
	*/ & regex(wpname, "(FAO)|(OCDE)|(COORD)") == 0
*groups wpname if wpcode2 == "H15", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "H15" & wpcode2 != "H15" & wpcode != "Z00" /*
	*/ & regex(wpname, "FORET") /*
	*/ & regex(wpname, "(FAO)|(OCDE)|(COORD)") == 0 /*
	*/ , order(h) show(freq Freq)

* Make correction
* UN coordination working party
replace wpcode = "C27" if wpname == "COORDINATION PANEL FORETS" 
	

* Working Party on Fruit and Vegetables: Bananas
* BANANES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BANAN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H16a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BANAN")
*groups wpname if wpcode == "H16a", order(h) miss

**groups wpname if wpcode != "H16a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "BANAN") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Fruit and Vegetables: Fresh Fruit and Vegetables
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FRAIS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H16b" if  wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FRAIS")
*groups wpname if wpcode == "H16b", order(h) miss

**groups wpname if wpcode != "H16b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FRAIS") /*
	*/ , order(h) show(freq Freq)


* Working Party on Fruit and Vegetables: Processed Fruit and Vegetables
* Fruits et l�gumes transform�s
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "FRUIT.*TRANS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H16c" if wpcode == "" /*
	*/ & regexm(wpname, "FRUIT.*TRANS") /*
	*/ & regexm(wpname, "CODEX") == 0
*groups wpname if wpcode == "H16c", order(h) miss
	
*groups wpname if wpcode != "H16c" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FRUIT.*TRANS") /*
	*/ , order(h) show(freq Freq)
* Codex alimentarius meeting
* No observations


* Working Party on Fruit and Vegetables: Potatoes
* POMMES DE TERRE
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "POMME") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H16d" if wpcode == "" /*
	*/ & regexm(wpname, "POMME")
*groups wpname if wpcode == "H16d", order(h) miss
	
*groups wpname if wpcode != "H16d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "POMME") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Fruit and Vegetables
* FRUITS ET LEGUMES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(FRUITS)|(LEGUME)") /*
	*/ & regex(wpname, "CODEX") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H16" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(FRUITS)|(LEGUME)") /*
	*/ & regex(wpname, "CODEX") == 0
*groups wpname if wpcode == "H16", order(h) miss

**groups wpname if wpcode != "H16" & regexm(wpcode, "H16") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "(FRUITS)|(LEGUME)") /*
	*/ & regex(wpname, "CODEX") == 0 /*
	*/ , order(h) show(freq Freq)


* Working Party on Hops
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & wpname == "HOUBLON" /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H17" if wpcode == "" & wpcode != "Z00" /*
	*/ & wpname == "HOUBLON"
*groups wpname if wpcode == "H17", order(h) miss

**groups wpname if wpcode != "H17" & wpcode != "Z00" /*
	*/ & wpname == "HOUBLON" /*
	*/ , order(h) show(freq Freq)


* Working Party on Horizontal Agricultural Questions
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(QUEST.*HORIZ.*AGRI)|(QUEST.*AGRI.*HORIZ)|(QUEST.*GENERAL.*AGRI)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H18" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(QUEST.*HORIZ.*AGRI)|(QUEST.*AGRI.*HORIZ)|(QUEST.*GENERAL.*AGRI)")
*groups wpname if wpcode == "H18", order(h) miss

**groups wpname if wpcode != "H18" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(QUEST.*HORIZ.*AGRI)|(QUEST.*AGRI.*HORIZ)|(QUEST.*GENERAL.*AGRI)") /*
	*/ , order(h) show(freq Freq)


* Working Party on Horizontal Agricultural Questions: Simplification of the CAP
* Simplification de la PAC
* Successor to H11
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "SIMPLIF.*P") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H18a" if wpcode == "" /*
	*/ & regexm(wpname, "SIMPLIF.*P")
*groups wpname if wpcode == "H18a", order(h) miss
	
*groups wpname if wpcode != "H18a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SIMPLIF.*P") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode != "H18a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SIMPLIF.*P")
replace wpcode = "H18a" if wpcode != "H18a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SIMPLIF.*P") & date >= d(04mar2003)


*Working Party on Horizontal Agricultural Questions: Strengthening of Controls (incl. Integrated System)
* Renforcement des contr�les (Y compris le syst�me int�gr�)
* H18b, successor to H26
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "(RENF.*CONTR)|(SYS.*INTEG)") /*
	*/ , order(h) show(freq Freq)
list date wpcode wpname if wpcode == "" /*
	*/ & regex(wpname, "(RENF.*CONTR)|(SYS.*INTEG)") 
* All meetings of successor working party
* No observations


* Working Party on Milk and Milk Products
* Lait et produits lai
* H19, succeeded by H08e
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "LAIT") /*
	*/ & regexm(wpname, "CODEX") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H19" if wpcode == "" /*
	*/ & regexm(wpname, "LAIT")/*
	*/ & regexm(wpname, "CODEX") == 0
*groups wpname if wpcode == "H19", order(h) miss
	
groups wpname if wpcode != "H19" & wpcode != "Z00" /*
	*/ & regexm(wpname, "LAIT") /*
	*/ , order(h) show(freq Freq)
list date wpcode wpname if wpcode != "H19" & wpcode != "Z00" /*
	*/ & regexm(wpname, "LAIT") /*
	*/ & regexm(wpname, "CODEX") == 0
	
* Make corrections
replace wpcode = "H19" if wpcode != "H19" & wpcode != "Z00" /*
	*/ & regexm(wpname, "LAIT") /*
	*/ & regexm(wpname, "CODEX") == 0 & date < d(30oct2001)
	

* Working Party on Products not listed in Annex I
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ANNEXE I") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H20" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ANNEXE I")
*groups wpname if wpcode == "H20", order(h) miss

**groups wpname if wpcode != "H20" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ANNEXE I") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Olive Oil (incl. Table Olives)
*HUILE D'OLIVE (Y COMPRIS OLIVES DE TABLE)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OLIVE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H21" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OLIVE")
*groups wpname if wpcode == "H21", order(h) miss

**groups wpname if wpcode != "H21" & wpcode != "Z00" /*
	*/ & regexm(wpname, "OLIVE") /*
	*/ , order(h) show(freq Freq)


* Working Party on Plant Health: Protection and Inspection
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROT.*INSPEC") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H23a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROT.*INSPEC")
*groups wpname if wpcode == "H23a", order(h) miss

**groups wpname if wpcode != "H23a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PROT.*INSPEC") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Plant Health: Propagating and Planting Materials
* PLANTS ET MATERIEL DE MULTIPLICATION
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MULTIP") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H23b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MULTIP")
*groups wpname if wpcode == "H23b", order(h) miss

**groups wpname if wpcode != "H23b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MULTIP") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Plant Health: Rosendaal Group
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(ROO?SENDAAL)|(Roosendaal)|(ROOSENDAL)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H23c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(ROO?SENDAAL)|(Roosendaal)|(ROOSENDAL)")
*groups wpname if wpcode == "H23c", order(h) miss

**groups wpname if wpcode != "H23c" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(ROO?SENDAAL)|(Roosendaal)|(ROOSENDAL)") /*
	*/ , order(h) show(freq Freq)	
	
**
* Working Party on Plant Health: International Plant Protection Convention/Commission on Phytosanitary Measures (IPPC/CPM) Affairs
* Convention internationale pour la protection des v�g�taux/Commission des mesures phytosanitaires
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(IPPC)|(CPM)|(CIPV)|(CMP)|(PLANT PROT.* CONV)|(COM.* PHYTO)|(CONV.* PROT)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H23d" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(IPPC)|(CPM)|(CIPV)|(CMP)|(PLANT PROT.* CONV)|(COM.* PHYTO)|(CONV.* PROT)")
*groups wpname if wpcode == "H23d", order(h) miss

*groups wpname if wpcode != "H23d" & wpcode != "Z00" /*
	*/ & regex(wpname, "(IPPC)|(CPM)|(CIPV)|(CMP)|(PLANT PROT.* CONV)|(COM.* PHYTO)|(CONV.* PROT)") /*
	*/ , order(h) show(freq Freq)
* Correction
replace wpcode = "H23d" if wpcode != "H23d" & wpcode != "Z00" /*
	*/ & regex(wpname, "(IPPC)|(CPM)|(CIPV)|(CMP)|(PLANT PROT.* CONV)|(COM.* PHYTO)|(CONV.* PROT)")
	

* Working Party on Plant Health
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PHYTOSAN") /*
	*/ & regex(wpname, "(CHEF)|(FAO)|(AD HOC)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H23" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PHYTOSAN") /*
	*/ & regex(wpname, "(CHEF)|(FAO)|(AD HOC)") == 0
*groups wpname if wpcode == "H23", order(h) miss

**groups wpname if wpcode != "H23" & regexm(wpcode, "H23") == 0 & wpcode != "Z00" /*
	*/ & regex(wpname, "PHYTOSAN") /*
	*/ & regex(wpname, "(CHEF)|(FAO)|(AD HOC)") == 0 /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Chief Plant Health Officers
* DIRECTEURS GENERAUX/CHEFS DE SERVICES PHYTOSANITAIRES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CHEF.*PHYTOSAN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H22" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CHEF.*PHYTOSAN")
*groups wpname if wpcode == "H22", order(h) miss

*groups wpname if wpcode != "H22" & wpcode != "Z00" /*
	*/ & regex(wpname, "CHEF.*PHYTOSAN") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "H22" if wpcode != "H22" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "CHEF.*PHYTOSAN")
*groups wpname if wpcode2 == "H22", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "H22" & wpcode2 != "H22" & wpcode != "Z00" /*
	*/ & regex(wpname, "CHEF.*PHYTOSAN") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on the Promotion of Agricultural Products
* PROMOTION DES PRODUITS AGRICOLES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROMOTION") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H24" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROMOTION")
*groups wpname if wpcode == "H24", order(h) miss

**groups wpname if wpcode != "H24" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PROMOTION") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Foodstuff Quality: Organic Farming
* AGRICULTURE BIOLOGIQUE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRI.*BIOL") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H25a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRI.*BIOL")
*groups wpname if wpcode == "H25a", order(h) miss

**groups wpname if wpcode != "H25a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AGRI.*BIOL") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Foodstuff Quality: Geographical Indications and Designations of Origin
* INDICATIONS GEOGRAPHIQUES ET APPELLATIONS
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "IND.*GEO") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H25b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "IND.*GEO")
*groups wpname if wpcode == "H25b", order(h) miss

**groups wpname if wpcode != "H25b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "IND.*GEO") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Foodstuff Quality: Certificates of Specific Character
* ATTESTATIONS DE SPECIFICITE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ATTEST") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H25c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ATTEST")
*groups wpname if wpcode == "H25c", order(h) miss

**groups wpname if wpcode != "H25c" & wpcode != "Z00" /*
	*/ & regex(wpname, "ATTEST") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Foodstuff Quality
* QUALITE DES ALIMENTS
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "QUAL.*ALIM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H25" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "QUAL.*ALIM")
*groups wpname if wpcode == "H25", order(h) miss

**groups wpname if wpcode != "C19" & regexm(wpcode, "H25") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "QUAL.*ALIM") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Strengthening of Controls (incl. Integrated System)
* RENFORCEMENT DES CONTROLES (Y COMPRIS SYSTEME INTEGRE)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RENF.*CONTR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H26" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RENF.*CONTR")
*groups wpname if wpcode == "H26", order(h) miss

*groups wpname if wpcode != "H26" & wpcode != "Z00" /*
	*/ & regex(wpname, "RENF.*CONTR") /*
	*/ , order(h) show(freq Freq)


* Working Party on Sugar and Isoglucose
* SUCRE ET ISOGLUCOSE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SUCRE") /*
	*/ & regex(wpname, "(CODEX)|(OCDE)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H27" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SUCRE") /*
	*/ & regex(wpname, "(CODEX)|(OCDE)") == 0
*groups wpname if wpcode == "H27", order(h) miss

*groups wpname if wpcode != "H27" & wpcode != "Z00" /*
	*/ & regex(wpname, "SUCRE") /*
	*/ & regex(wpname, "(CODEX)|(OCDE)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "H27" if wpcode != "H27" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "SUCRE") /*
	*/ & regex(wpname, "(CODEX)|(OCDE)") == 0
*groups wpname if wpcode2 == "H27", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "H27" & wpcode2 != "H27" & wpcode != "Z00" /*
	*/ & regex(wpname, "SUCRE") /*
	*/ & regex(wpname, "(CODEX)|(OCDE)") == 0 /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode = "Z00" if index(wpname, "TRILATERALES SUCRE") > 0
		

* Working Party on Textile Fibres: Cotton
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COTON") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H28a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COTON")
*groups wpname if wpcode == "H28a", order(h) miss

**groups wpname if wpcode != "H28a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COTON") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Textile Fibres: Flax and Hemp
*LIN ET CHANVRE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CHANVRE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H28b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CHANVRE")
*groups wpname if wpcode == "H28b", order(h) miss

**groups wpname if wpcode != "H28b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CHANVRE") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Textile Fibres: Silk Worms
* Vers � soie
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(VERS)|(SOIE)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H28c" if wpcode == "" /*
	*/ & regexm(wpname, "SOIE")
*groups wpname if wpcode == "H28c", order(h) miss
	
*groups wpname if wpcode != "H28c" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(VERS)|(SOIE)") /*
	*/ , order(h) show(freq Freq)	
* No observations


* Working Party on Textile Fibres
* FIBRES TEXTILES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FIB") /*
	*/ & regex(wpname, "SPECIAL") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H28" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FIB") /*
	*/ & regex(wpname, "SPECIAL") == 0
*groups wpname if wpcode == "H28", order(h) miss

**groups wpname if wpcode != "H28" & regexm(wpcode, "H28") == 0 & wpcode != "Z00" /*
	*/ & regex(wpname, "FIB") /*
	*/ & regex(wpname, "SPECIAL") == 0 /*
	*/ , order(h) show(freq Freq)


* Working Party on Tobacco
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TABAC") /*
	*/ & regex(wpname, "SPEC") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H29" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TABAC") /*
	*/ & regex(wpname, "SPEC") == 0
*groups wpname if wpcode == "H29", order(h) miss

**groups wpname if wpcode != "H29" & wpcode != "Z00" /*
	*/ & regex(wpname, "TABAC") /*
	*/ & regex(wpname, "SPEC") == 0 /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Wines and Alcohols: Wines
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, " VIN") /*
	*/ & regex(wpname, "(ALCOOL)|(AROMAT)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H30a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, " VIN") /*
	*/ & regex(wpname, "(ALCOOL)|(AROMAT)") == 0
*groups wpname if wpcode == "H30a", order(h) miss
replace wpcode = "H30a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VINS ET ALCOOLS: VIN")
*groups wpname if wpcode == "H30a", order(h) miss

**groups wpname if wpcode != "H30a" & wpcode != "Z00" /*
	*/ & ((regex(wpname, " VIN") /*
	*/ & regex(wpname, "(ALCOOL)|(AROMAT)") == 0) /*
	*/ | regex(wpname, "VINS ET ALCOOLS: VIN")) /*
	*/ , order(h) show(freq Freq)


* Working Party on Wines and Alcohols: Aromatised Wines
* VINS AROMATISES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AROMAT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H30b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AROMAT")
*groups wpname if wpcode == "H30b", order(h) miss

**groups wpname if wpcode != "H30b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AROMAT") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Wines and Alcohols: Spirit drinks
* BOISSONS SPIRITUEUSES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SPIRIT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H30c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SPIRIT")
*groups wpname if wpcode == "H30c", order(h) miss

**groups wpname if wpcode != "H30c" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SPIRIT") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Wines and Alcohols: Alcohol
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ALCOOL") /*
	*/ , order(h) show(freq Freq)
*replace wpcode = "H30d" if wpcode == "" /*
	*/ & regexm(wpname, "")
*groups wpname if wpcode == "H30d", order(h) miss
	
*groups wpname if wpcode != "H30d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ALCOOL") /*
	*/ , order(h) show(freq Freq)	
* No observations


* Working Party on Wines and Alcohols: Vinegar
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VINAI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H30e" if wpcode == "" /*
	*/ & regexm(wpname, "VINAI")
*groups wpname if wpcode == "H30e", order(h) miss
	
*groups wpname if wpcode != "H30e" & wpcode != "Z00" /*
	*/ & regexm(wpname, "VINAI") /*
	*/ , order(h) show(freq Freq)
* No observations	


* Working Party on Wines and Alcohols: International Organisation of Vine and Wine (OIV)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OIV") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H30f" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OIV")
*groups wpname if wpcode == "H30f", order(h) miss

**groups wpname if wpcode != "H30f" & wpcode != "Z00" /*
	*/ & regex(wpname, "OIV") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Wines and Alcohols
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ALCO") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H30" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ALCO")
*groups wpname if wpcode == "H30", order(h) miss

*groups wpname if wpcode != "H30" & regexm(wpcode, "H30") == 0 & wpcode != "Z00" /*
	*/ & regex(wpname, "ALCO") /*
	*/ , order(h) show(freq Freq)

	
* Working Party of Chief Veterinary Officers
* DIRECTEURS GENERAUX/CHEFS DES SERVICES VETERINAIRES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CHEF.*VET") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H31" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CHEF.*VET")
*groups wpname if wpcode == "H31", order(h) miss

*groups wpname if wpcode != "H31" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CHEF.*VET") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "H31" if wpcode != "H31" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "CHEF.*VET")
*groups wpname if wpcode2 == "H31", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "H31" & wpcode2 != "H31" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CHEF.*VET") /*
	*/ , order(h) show(freq Freq)
	

* Working Party of Veterinary Experts: Public Health
* SANTE PUBLIQUE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VET.*SANTE.*PUB") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H32a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VET.*SANTE.*PUB")
*groups wpname if wpcode == "H32a", order(h) miss

**groups wpname if wpcode != "H32a" & wpcode != "Z00" /*
	*/ & regex(wpname, "VET.*SANTE.*PUB") /*
	*/ , order(h) show(freq Freq)
	

* Working Party of Veterinary Experts: Animal Health
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SANTE ANIMALE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H32b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SANTE ANIMALE")
*groups wpname if wpcode == "H32b", order(h) miss

*groups wpname if wpcode != "H32b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SANTE ANIMALE") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "H32b" if wpcode != "H32b" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "SANTE ANIMALE")
*groups wpname if wpcode2 == "H32b", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "H32b" & wpcode2 != "H32b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SANTE ANIMALE") /*
	*/ , order(h) show(freq Freq)
	

* Working Party of Veterinary Experts: Animal Welfare
* BIEN-ETRE DES ANIMAUX
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(BIEN - ETRE)|(PROTECT.*ANIM)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H32c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(BIEN - ETRE)|(PROTECT.*ANIM)")
*groups wpname if wpcode == "H32c", order(h) miss

**groups wpname if wpcode != "H32c" & wpcode != "Z00" /*
	*/ & regex(wpname, "(BIEN - ETRE)|(PROTECT.*ANIM)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party of Veterinary Experts: Fishery Products
* PRODUITS DE LA PECHE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AQUACULT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H32d" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AQUACULT")
*groups wpname if wpcode == "H32d", order(h) miss

**groups wpname if wpcode != "H32d" & wpcode != "Z00" /*
	*/ & regex(wpname, "AQUACULT") /*
	*/ , order(h) show(freq Freq)
	

* Working Party of Veterinary Experts: Potsdam Group
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "POTSDAM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H32e" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "POTSDAM")
*groups wpname if wpcode == "H32e", order(h) miss

*groups wpname if wpcode != "H32e" & wpcode != "Z00" /*
	*/ & regexm(wpname, "POTSDAM") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "H32e" if wpcode != "H32e" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "POTSDAM")
*groups wpname if wpcode2 == "H32e", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "H32e" & wpcode2 != "H32e" & wpcode != "Z00" /*
	*/ & regexm(wpname, "POTSDAM") /*
	*/ , order(h) show(freq Freq)
	

* Working Party of Veterinary Experts: Third Countries
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VETERINAIRES.*PAYS TIERS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H32f" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VETERINAIRES.*PAYS TIERS")
*groups wpname if wpcode == "H32f", order(h) miss

**groups wpname if wpcode != "H32f" & wpcode != "Z00" /*
	*/ & regexm(wpname, "VETERINAIRES.*PAYS TIERS") /*
	*/ , order(h) show(freq Freq)


* Working Party of Veterinary Experts: Animal Husbandry
* Successor to H33
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ZOOTECHNIE") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ZOOTECHNIE")
replace wpcode = "H32g" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ZOOTECHNIE") & date >= d(30oct2001)
*groups wpname if wpcode == "H32g", order(h) miss

*groups wpname if wpcode != "H32g" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ZOOTECHNIE") & date >= d(30oct2001) /*
	*/ , order(h) show(freq Freq)
* No observations
	

* Working Party of Veterinary Experts
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(^VET)|( VET)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H32" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(^VET)|( VET)")
*groups wpname if wpcode == "H32", order(h) miss

*groups wpname if wpcode != "H32" & regexm(wpcode, "H32") == 0 & wpcode != "H31" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(^VET)|( VET)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "H32" if wpcode != "H32" & regexm(wpcode, "H32") == 0 & wpcode != "H31" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(^VET)|( VET)")
*groups wpname if wpcode2 == "H32", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "H32" & wpcode2 != "H32" & regexm(wpcode, "H32") == 0 & wpcode != "H31"  & wpcode != "Z00" /*
	*/ & regexm(wpname, "(^VET)|( VET)") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Animal Husbandry
* H33, succeeded by H32g
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ZOOTECHNIE") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ZOOTECHNIE")
replace wpcode = "H33" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ZOOTECHNIE") & date < d(30oct2001)
*groups wpname if wpcode == "H33", order(h) miss

*groups wpname if wpcode != "H33" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ZOOTECHNIE") & date < d(30oct2001) /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "H33" if wpcode != "H33" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "ZOOTECHNIE") & date < d(30oct2001)
*groups wpname if wpcode2 == "H33", order(h) miss show(freq Freq)	


* Working Party on Contaminants of Agricultural Origin
* CONTAMINANTS D'ORIGINE AGRICOLE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CONTAM.*ORIG") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H34" if wpcode == "CONTAM.*ORIG" /*
	*/ & regexm(wpname, "")
*groups wpname if wpcode == "H34", order(h) miss
	
*groups wpname if wpcode != "H34" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CONTAM.*ORIG") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Agricultural questions
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "QUESTIONS AGRI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H07" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "QUESTIONS AGRI")
*groups wpname if wpcode == "H07", order(h) miss

**groups wpname if wpcode != "H07" & wpcode != "Z00" /*
	*/ & regexm(wpname, "QUESTIONS AGRI") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "H07" if regexm(wpcode, "H") == 0 & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "QUESTIONS AGRI")

* Make corrections
replace wpcode = "H24" if wpname == "QUESTIONS AGRI (PROM. PROD. AGRI)"	
replace wpcode = "H36" if wpname == "QUESTIONS AGRI COORDINATION FAO"	
	

* OECD Coordination Working Party: Committee for Agriculture
* Coordination OCDE: Comit� de l'agriculture
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OCDE.* ((COMITE)|(AGRI))") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H35a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OCDE.* ((COMITE)|(AGRI))")
*groups wpname if wpcode == "H35a", order(h) miss

**groups wpname if wpcode != "H35a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "OCDE.* ((COMITE)|(AGRI))") /*
	*/ , order(h) show(freq Freq)
* No observations


* OECD Coordination Working Party: Statistics
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OCDE.*STAT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H35b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OCDE.*STAT")
*groups wpname if wpcode == "H35b", order(h) miss

**groups wpname if wpcode != "H35b" & wpcode != "Z00" /*
	*/ & regex(wpname, "OCDE.*STAT") /*
	*/ , order(h) show(freq Freq)
* No observations


* OECD Coordination Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(OCDE)|(OECD)") /*
	*/ & regex(wpname, "AGRI") /* 
	*/ , order(h) show(freq Freq)
replace wpcode = "H35" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(OCDE)|(OECD)") /*
	*/ & regex(wpname, "AGRI")
*groups wpname if wpcode == "H35", order(h) miss
	
*groups wpname if wpcode != "H35" & regexm(wpcode, "H35") == 0 & wpcode != "Z00" /*
	*/ & regex(wpname, "(OCDE)|(OECD)") /*
	*/ & regex(wpname, "AGRI") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "H35" if wpcode != "H35" & regexm(wpcode, "H35") == 0 & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "(OCDE)|(OECD)") /*
	*/ & regex(wpname, "AGRI")
*groups wpname if wpcode2 == "H35", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "H35" & wpcode2 != "H35" & regexm(wpcode, "H35") == 0 & wpcode != "Z00" /*
	*/ & regex(wpname, "(OCDE)|(OECD)") /*
	*/ & regex(wpname, "AGRI") /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode = "H35" if wpname == "COORDINATION OCDE MARCHE LAIT ET VIANDE"


* FAO Coordination Working Party (Agriculture)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "F\.?A\.?O") /*
	*/ & regex(wpname, "(CODEX)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H36" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "F\.?A\.?O") /*
	*/ & regex(wpname, "(CODEX)") == 0
*groups wpname if wpcode == "C19", order(h) miss

*groups wpname if wpcode != "H36" & wpcode != "Z00" /*
	*/ & regex(wpname, "F\.?A\.?O") /*
	*/ & regex(wpname, "(CODEX)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "H36" if wpcode != "H36" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "F\.?A\.?O") /*
	*/ & regex(wpname, "(CODEX)") == 0
*groups wpname if wpcode2 == "H36", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "H36" & wpcode2 != "H36" & wpcode != "Z00" /*
	*/ & regex(wpname, "F\.?A\.?O") /*
	*/ & regex(wpname, "(CODEX)") == 0 /*
	*/ , order(h) show(freq Freq)
	

* Codex Alimentarius Working Party: General Principles
* PRINCIPES GENERAUX
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PRINC.*GEN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37a" if wpcode == "" /*
	*/ & regexm(wpname, "PRINC.*GEN")
*groups wpname if wpcode == "H37a", order(h) miss
	
*groups wpname if wpcode != "H37a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PRINC.*GEN") /*
	*/ , order(h) show(freq Freq)
	
	
* Codex Alimentarius Working Party: Food Additives and Contaminants
* ADDITIFS ALIMENTAIRES ET CONTAMINANTS
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CONTAM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CONTAM")
*groups wpname if wpcode == "H37b", order(h) miss

**groups wpname if wpcode != "H37b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CONTAM") /*
	*/ , order(h) show(freq Freq)


* Codex Alimentarius Working Party: Food Hygiene
* HYGIENE DES DENREES ALIMENTAIRES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HYGIENE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HYGIENE")
*groups wpname if wpcode == "H37c", order(h) miss

**groups wpname if wpcode != "H37c" & wpcode != "Z00" /*
	*/ & regexm(wpname, "HYGIENE") /*
	*/ , order(h) show(freq Freq)
	

* Codex Alimentarius Working Party: Food Labelling
* ETIQUETAGE DES DENREES ALIMENTAIRES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ETIQU") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37d" if wpcode == "" /*
	*/ & regexm(wpname, "ETIQU.* DEN")
*groups wpname if wpcode == "H37d", order(h) miss
	
*groups wpname if wpcode != "H37d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ETIQUET") /*
	*/ & regexm(wpname, "BOVINE") == 0 /*
	*/ , order(h) show(freq Freq)	
* No observations


* Codex Alimentarius Working Party: Methods of Analysis and Sampling
* METHODES D'ANALYSE ET D'ECHANTILLONNAGE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(ANALYSE)|(ECHANT)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37e" if wpcode == "" /*
	*/ & regexm(wpname, "(ANALYSE)|(ECHANT)")
*groups wpname if wpcode == "H37e", order(h) miss
	
*groups wpname if wpcode != "H37e" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(ANALYSE)|(ECHANT)") /*
	*/ , order(h) show(freq Freq)
* No observations


* Codex Alimentarius Working Party: Pesticide Residues
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RES.*PEST") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37f" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RES.*PEST")
*groups wpname if wpcode == "H37f", order(h) miss

**groups wpname if wpcode != "H37f" & wpcode != "Z00" /*
	*/ & regexm(wpname, "RES.*PEST") /*
	*/ , order(h) show(freq Freq)


* Codex Alimentarius Working Party: Residues of Veterinary Drugs in Foods
* RESIDUS DE MEDICAMENTS VETERINAIRES DANS LES ALIMENTS
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RES.*MED") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37g" if wpcode == "" /*
	*/ & regexm(wpname, "RES.*MED")
*groups wpname if wpcode == "H37g", order(h) miss
	
*groups wpname if wpcode != "H37g" & wpcode != "Z00" /*
	*/ & regexm(wpname, "RES.*MED") /*
	*/ , order(h) show(freq Freq)
* No observations


* Codex Alimentarius Working Party: Food Import and Export Certification and Inspection Systems
* SYSTEMES D'INSPECTION ET DE CERTIFICATION DES IMPORTATIONS ET DES EXPORTATIONS DE DENREES ALIMENTAIRES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CERT)|(INSP)|(IMPORT)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37h" if wpcode == "" /*
	*/ & regexm(wpname, "(CERT)|(INSP)|(IMPORT)")
*groups wpname if wpcode == "H37h", order(h) miss
	
*groups wpname if wpcode != "H37h" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CERT)|(INSP)|(IMPORT)") /*
	*/ , order(h) show(freq Freq)

	
* Codex Alimentarius Working Party: Nutrition and Foods for Special Dietary Uses
* NUTRITION ET ALIMENTS DIETETIQUES OU DE REGIME
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(NUTRI)|(DIET)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37i" if wpcode == "" /*
	*/ & regexm(wpname, "(NUTRI.* ALI)|(DIET)")
*groups wpname if wpcode == "H37i", order(h) miss
	
*groups wpname if wpcode != "H37i" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(NUTRI)|(DIET)") /*
	*/ , order(h) show(freq Freq)
* No observations


* Codex Alimentarius Working Party: Cocoa Products and Chocolate
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CACAO") /*
	*/ & regex(wpname, "CODEX") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37j" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CACAO") /*
	*/ & regex(wpname, "CODEX")
*groups wpname if wpcode == "H37j", order(h) miss

**groups wpname if wpcode != "H37j" & wpcode != "Z00" /*
	*/ & regex(wpname, "CACAO") /*
	*/ & regex(wpname, "CODEX") /*
	*/ , order(h) show(freq Freq)
	

* Codex Alimentarius Working Party: Sugars
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SUCRE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37k" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SUCRE")
*groups wpname if wpcode == "H37k", order(h) miss

**groups wpname if wpcode != "H37k" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SUCRE") /*
	*/ , order(h) show(freq Freq)

	
* Codex Alimentarius Working Party: Processed Fruits and Vegetables
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(TRANSF)|(TRAITES)") /*
	*/ & regex(wpname, "CODEX") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37l" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(TRANSF)|(TRAITES)") /*
	*/ & regex(wpname, "CODEX")
*groups wpname if wpcode == "H37l", order(h) miss

**groups wpname if wpcode != "H37l" & wpcode != "Z00" /*
	*/ & regex(wpname, "(TRANSF)|(TRAITES)") /*
	*/ & regex(wpname, "CODEX") /*
	*/ , order(h) show(freq Freq)


* Codex Alimentarius Working Party: Oils and Fats
* HUILES ET GRAISSES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GRAISSES") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37m" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GRAISSES")
*groups wpname if wpcode == "H37m", order(h) miss

**groups wpname if wpcode != "H37m" & wpcode != "Z00" /*
	*/ & regexm(wpname, "GRAISSES") /*
	*/ , order(h) show(freq Freq)
	

* Codex Alimentarius Working Party: Fish and Fishery Products
* POISSONS ET PRODUITS DE LA PECHE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CODEX.*PECHE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37n" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CODEX.*PECHE")
*groups wpname if wpcode == "H37n", order(h) miss

**groups wpname if wpcode != "H37n" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CODEX.*PECHE") /*
	*/ , order(h) show(freq Freq)
	

* Codex Alimentarius Working Party: Fresh Fruits and Vegetables
* FRUITS ET LEGUMES FRAIS
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FRUIT") /*
	*/ & regex(wpname, "JUS") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37o" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FRUIT") /*
	*/ & regex(wpname, "JUS") == 0
*groups wpname if wpcode == "H37o", order(h) miss

**groups wpname if wpcode != "H37o" & wpcode != "Z00" /*
	*/ & regex(wpname, "FRUIT") /*
	*/ & regex(wpname, "JUS") == 0 /*
	*/ , order(h) show(freq Freq)
	

* Codex Alimentarius Working Party: Milk and Milk Products
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "LAIT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37p" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "LAIT")
*groups wpname if wpcode == "H37p", order(h) miss

**groups wpname if wpcode != "H37p" & wpcode != "Z00" /*
	*/ & regexm(wpname, "LAIT") /*
	*/ , order(h) show(freq Freq)

	
* Codex Alimentarius Working Party: Natural Mineral Waters
* Eau min�rale naturelle
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EAU MIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37q" if wpcode == "" /*
	*/ & regexm(wpname, "EAU MIN")
*groups wpname if wpcode == "H37q", order(h) miss
	
*groups wpname if wpcode != "H37q" & wpcode != "Z00" /*
	*/ & regexm(wpname, "EAU MIN") /*
	*/ , order(h) show(freq Freq)
* No observations
		

* Codex Alimentarius Working Party: Task Force on Biotechnology
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CODEX.*BIOTECH") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37r" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CODEX.*BIOTECH")
*groups wpname if wpcode == "H37r", order(h) miss

**groups wpname if wpcode != "H37r" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CODEX.*BIOTECH") /*
	*/ , order(h) show(freq Freq)
	

* Codex Alimentarius Working Party: Task Force on Fruit Juices
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "JUS ") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37s" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "JUS ")
*groups wpname if wpcode == "H37s", order(h) miss

**groups wpname if wpcode != "H37s" & wpcode != "Z00" /*
	*/ & regexm(wpname, "JUS ") /*
	*/ , order(h) show(freq Freq)
	

* Codex Alimentarius Working Party: Task Force on Animal Feed
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ALIM.*ANIM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37t" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ALIM.*ANIM")
*groups wpname if wpcode == "H37t", order(h) miss

**groups wpname if wpcode != "H37t" & wpcode != "Z00" /*
	*/ & regex(wpname, "ALIM.*ANIM") /*
	*/ , order(h) show(freq Freq)
	

* Codex Alimentarius Working Party: Coordinating Committee for Europe
* Comit� de coordination pour l'Europe
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COMIT.* COORD") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37u" if wpcode == "" /*
	*/ & regexm(wpname, "COMIT.* COORD")
*groups wpname if wpcode == "H37u", order(h) miss
	
*groups wpname if wpcode != "H37u" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COMIT.* COORD") /*
	*/ , order(h) show(freq Freq)	
		
	
* Codex Alimentarius Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CODEX") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H37" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CODEX")
*groups wpname if wpcode == "H37", order(h) miss

**groups wpname if wpcode != "H37" & regexm(wpcode, "H37") wpcode != "Z00" /*
	*/ & regexm(wpname, "CODEX") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Agricultural Structures and Rural Development
* Groupe "Structures agricoles et d�veloppement rural"
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "(STRUCT.*AGRI)|(RURAL)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H38" if wpcode == "" /*
	*/ & regexm(wpname, "(STRUCT.*AGRI)|(RURAL)")
*groups wpname if wpcode == "H38", order(h) miss
	
*groups wpcode wpname if wpcode != "H38" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(STRUCT.*AGRI)|(RURAL)") & date >= d(30oct2001) /*
	*/ , order(h) show(freq Freq)
*list date wpcode wpname if wpcode != "H38" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(STRUCT.*AGRI)|(RURAL)") & date >= d(30oct2001)
	
* Make correction
replace wpcode = "H38" if wpcode != "H38" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(STRUCT.*AGRI)|(RURAL)") & date >= d(30oct2001)
*groups wpname if wpcode == "H38", order(h) miss
replace wpcode = "" if wpname == "STRUCTURES AGRI - DEVELOPPEM. RURAL (ILES DE LA MER EG�E)"


* Working Party on Agricultural Structures and Rural Development: Agriculture and Environment
* Groupe "Structures agricoles et d�veloppement rural": Agriculture et environnement
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "AGRI.*ENVI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H38a" if wpcode == "" /*
	*/ & regexm(wpname, "AGRI.*ENVI")
*groups wpname if wpcode == "H38a", order(h) miss
	
*groups wpcode wpname if wpcode != "H38a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AGRI.*ENVI") & date >= d(30oct2001) /*
	*/ , order(h) show(freq Freq)
* No observations
	

* Working Party on Agricultural Structures and Rural Development: Rural Development
* Groupe "Structures agricoles et d�veloppement rural": D�veloppement rural
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "RURAL") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H38b" if wpcode == "" /*
	*/ & regexm(wpname, "RURAL$")
*groups wpname if wpcode == "H38b", order(h) miss
	
*groups wpcode wpname if wpcode != "H38b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "RURAL") & date >= d(30oct2001) /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode = "H38b" if wpcode != "H38b" & wpcode != "Z00" /*
	*/ & wpname == "DEVELOPPEMENT RURAL" & date >= d(30oct2001)


* Working Party on Agricultural Structures and Rural Development: Agricultural Structures
* Groupe "Structures agricoles et d�veloppement rural": Structures agricoles
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "STRUCT.*AGRI") /*
	*/ , order(h) show(freq Freq)
*replace wpcode = "H38c" if wpcode == "" /*
	*/ & regexm(wpname, "STRUCT.*AGRI")
*groups wpname if wpcode == "H38c", order(h) miss
	
*groups wpcode wpname if wpcode != "H38c" & wpcode != "Z00" /*
	*/ & regexm(wpname, "STRUCT.*AGRI") & date >= d(30oct2001) /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Agricultural Structures and Rural Development: Aegean Islands
* Groupe "Structures agricoles et d�veloppement rural": �les de la mer �g�e
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "DE LA MER") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H38d" if wpcode == "" /*
	*/ & regexm(wpname, "DE LA MER")
*groups wpname if wpcode == "H38d", order(h) miss
	
*groups wpcode wpname if wpcode != "H38d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DE LA MER EG") & date >= d(30oct2001) /*
	*/ , order(h) show(freq Freq)
*list date wpcode wpname if wpcode != "H38d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DE LA MER EG") & date >= d(30oct2001)
	
* Make correction
replace wpcode = "H38b" if wpcode != "H38d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DE LA MER EG") & date >= d(30oct2001)


* These are all successors of working parties with almost the same title

	
* Working Party on Special Plant Products: Floriculture
* Groupe "Produits v�g�taux sp�cialis�s": Floriculture
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FLORI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H39a" if wpcode == "FLORI" /*
	*/ & regexm(wpname, "")
*groups wpname if wpcode == "H39a", order(h) miss
	
*groups wpname if wpcode != "H39a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FLORI") /*
	*/ , order(h) show(freq Freq)	
*list date wpcode wpname if wpcode != "H39a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FLORI")
* No observations, all meetings earlier than establishment of group


* Working Party on Special Plant Products: Hops
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HOUBLON") /*
	*/ & regex(wpname, "FIBRES") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H39b" if wpcode == "FLORI" /*
	*/ & regex(wpname, "HOUBLON") /*
	*/ & regex(wpname, "FIBRES") == 0
*groups wpname if wpcode == "H39b", order(h) miss
	
*groups wpname if wpcode != "H39b" & wpcode != "Z00" /*
	*/ & regex(wpname, "HOUBLON") /*
	*/ & regex(wpname, "FIBRES") == 0 /*
	*/ , order(h) show(freq Freq)	
*list date wpcode wpname if wpcode != "H39b" & wpcode != "Z00" /*
	*/ & regex(wpname, "HOUBLON") /*
	*/ & regex(wpname, "FIBRES") == 0
* No observations, all meetings earlier than establishment of group
		
		
* Working Party on Special Plant Products: Tobacco
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TABAC") /*
	*/ & regex(wpname, "FIBRES") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H39c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TABAC") /*
	*/ & regex(wpname, "FIBRES") == 0
*groups wpname if wpcode == "H39c", order(h) miss

**groups wpname if wpcode != "H39c" & wpcode != "Z00" /*
	*/ & regex(wpname, "TABAC") /*
	*/ & regex(wpname, "FIBRES") == 0 /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Special Plant Products
**groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROD.*VEG") /*
	*/ & regex(wpname, "FIBRES") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H39" if wpcode == "" /*
	*/ & regexm(wpname, "PROD.*VEG") /*
	*/ & regex(wpname, "FIBRES") == 0
*groups wpname if wpcode == "H39", order(h) miss
	
*groups wpname if wpcode != "H39" & wpcode != "Z00" /*
	*/ & regex(wpname, "FIBRES") == 0 /*
	*/ & regexm(wpname, "PROD.*VEG") /*
	*/ , order(h) show(freq Freq)	
* No observations
	
	
* Working Party on Financial Agricultural Questions
* Groupe "Questions agrofinanci�res"
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRO.*FIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H40" if wpcode == "" /*
	*/ & regexm(wpname, "AGRO.*FIN")
*groups wpname if wpcode == "H40", order(h) miss
	
*groups wpname if wpcode != "H40" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AGRO.*FIN") /*
	*/ , order(h) show(freq Freq)	
*list date wpcode wpname if wpcode != "H40" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AGRO.*FIN")
	
* Make correction
replace wpcode = "H40" if wpcode != "H40" & wpcode != "Z00" /*
	*/ & wpname == "QUESTIONS AGROFINANCIERES" & date >= d(04mar2003) 
	
	
* Working Party on Financial Agricultural Questions: Agri-Monetary Questions
* Questions agromon�taires
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRO.*MON") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H40a" if wpcode == "" /*
	*/ & regexm(wpname, "AGRO.*MON")
*groups wpname if wpcode == "H40a", order(h) miss
	
*groups wpname if wpcode != "H40a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AGRO.*MON") /*
	*/ , order(h) show(freq Freq)	
*list date wpcode wpname if wpcode != "H40a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AGRO.*MON")
	
* Make correction
replace wpcode = "H40a" if wpcode != "H40a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "QUESTIONS AGROMONETAIRES") & date >= d(04mar2003) 


* Working Party on Financial Agricultural Questions: AGRIFIN
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRIFIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H40b" if wpcode == "" /*
	*/ & regexm(wpname, "AGRIFIN")
*groups wpname if wpcode == "H40b", order(h) miss
	
*groups wpname if wpcode != "H40b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AGRIFIN") /*
	*/ , order(h) show(freq Freq)	
*list date wpcode wpname if wpcode != "H40b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AGRIFIN")
	
* Make correction
replace wpcode = "H40b" if wpcode != "H40b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AGRIFIN") & date >= d(04mar2003) 


* These are successor working parties to older ones with the same name
	
	
* Working Party on Special Plant Products and Textile Fibres: Floriculture
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FLORI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H41a" if wpcode == "" /*
	*/ & regexm(wpname, "FLORI")
*groups wpname if wpcode == "H41a", order(h) miss
	
*groups wpname if wpcode != "H41a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FLORI") /*
	*/ , order(h) show(freq Freq)
list date wpcode wpname if wpcode != "H41a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FLORI")
* All meetings long before establishment of working party
* No observations

	
* Working Party on Special Plant Products and Textile Fibres: Hops
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HOUBLON") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H41b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HOUBLON")
*groups wpname if wpcode == "H41b", order(h) miss

**groups wpname if wpcode != "H41b" & wpcode != "Z00" /*
	*/ & regex(wpname, "HOUBLON") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Special Plant Products and Textile Fibres: Tobacco
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TABAC") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H41c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TABAC")
*groups wpname if wpcode == "H41c", order(h) miss

**groups wpname if wpcode != "H41c" & wpcode != "Z00" /*
	*/ & regex(wpname, "TABAC") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Special Plant Products and Textile Fibres: Cotton
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COTON") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H41d" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COTON")
*groups wpname if wpcode == "H41d", order(h) miss

*groups wpname if wpcode != "H41d" & wpcode != "Z00" /*
	*/ & regex(wpname, "COTON") /*
	*/ , order(h) show(freq Freq)
*list date wpcode wpname if wpcode != "H41d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COTON")
	
* Make correction
replace wpcode = "H41d" if wpcode != "H41d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COTON") & date >= d(04mar2003) 
	

* Working Party on Special Plant Products and Textile Fibres: Flax and Hemp
* Lin et chanvre
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "LIN .* CHANVRE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H41e" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "LIN .* CHANVRE")
*groups wpname if wpcode == "H41e", order(h) miss

*groups wpname if wpcode != "H41e" & wpcode != "Z00" /*
	*/ & regex(wpname, "CHANVRE") /*
	*/ , order(h) show(freq Freq)
*list date wpcode wpname if wpcode != "H41e" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CHANVRE")
* All meetings long before establishment of working party
* No observations


* Working Party on Special Plant Products and Textile Fibres: Silk Worms
* Vers � soie
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(VERS)|(SOIE)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H41f" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SOIE")
*groups wpname if wpcode == "H41f", order(h) miss

*groups wpname if wpcode != "H41f" & wpcode != "Z00" /*
	*/ & regex(wpname, "(VERS)|(SOIE)") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Special Plant Products and Textile Fibres: Textile Fibres
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FIBRE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H41g" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FIBRE")
*groups wpname if wpcode == "H41g", order(h) miss

**groups wpname if wpcode != "H41g" & wpcode != "Z00" /*
	*/ & regex(wpname, "FIBRE") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Special Plant Products and Textile Fibres
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROD.*VEG") & date >= d(04mar2003) /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H41" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROD.*VEG")
*groups wpname if wpcode == "H41", order(h) miss

*groups wpname if wpcode != "H41" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROD.*VEG") /*
	*/ , order(h) show(freq Freq)
* Group only seems to exist in the form of sub-groups
* No observations	
	
	
* Coordination Working Party
* Groupe "Coordination"
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COORD.*") /*
	*/ , order(h) show(freq Freq)
*groups wpname if wpcode != "H42" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COORD.*") & date >= d(04mar2003) /*
	*/ , order(h) show(freq Freq)	
* No observations
	
* Coordination Working Party: FAO
* Successor of pre-existing working party
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "FAO") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H42a" if wpcode == "" /*
	*/ & regexm(wpname, "FAO")
*groups wpname if wpcode == "H42a", order(h) miss
	
*groups wpcode wpname if wpcode != "H42a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FAO") /*
	*/ , order(h) show(freq Freq)
*list date wpcode wpname if wpcode != "H42a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FAO") & date >= d(04mar2003)
	
* Make correction
replace wpcode = "H42a" if wpcode != "H42a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FAO") & date >= d(04mar2003) 

* Coordination Working Party: OECD
* Successor of pre-existing working party
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "OCDE") /*
	*/ , order(h) show(freq Freq)
*replace wpcode = "H42b" if wpcode == "" /*
	*/ & regexm(wpname, "OCDE")
*groups wpname if wpcode == "H42a", order(h) miss
	
*groups wpcode wpname if wpcode != "H42b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "OCDE") /*
	*/ , order(h) show(freq Freq)
list date wpcode wpname if wpcode != "H42b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "OCDE") & date >= d(04mar2003)
* No observations


* High Level Working Party on CAP reform
* Groupe � haut niveau "R�forme de la PAC"
*groups wpname if wpcode == "" /*
	*/ & regex(wpname, "(HAUT NIVEAU)|(REFORM)|(P\.A\.C)") /*
	*/ , order(h) show(freq Freq)
*list date wpname if wpcode == "" /*
	*/ & regex(wpname, "(HAUT NIVEAU.*AGRI)|(REFORM)|(P\.A\.C)")
replace wpcode = "H43" if wpcode == "" /*
	*/ & regexm(wpname, "(HAUT NIVEAU.*AGRI)|(REFORM)|(P\.A\.C)") /*
	*/ & date >= d(07may2003)
*groups wpname if wpcode == "H43", order(h) miss
	
*groups wpcode wpname if wpcode != "H43" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(HAUT NIVEAU.*AGRI)|(REFORM)|(P\.A\.C)") /*
	*/ , order(h) show(freq Freq)
*list date wpcode wpname if wpcode != "H43" & wpcode != "Z00" /*
	*/ & regex(wpname, "(HAUT NIVEAU.*AGRI)|(REFORM)") /*
	*/ & date >= d(07may2003)
	
* Make correction
replace wpcode = "H43" if wpcode != "H43" & wpcode != "Z00" /*
	*/ & regex(wpname, "(HAUT NIVEAU.*AGRI)|(REFORM)") /*
	*/ & date >= d(07may2003)


* Ad hoc Working Party on Procedural Principles for Arrangements with Third Countries in the Veterinary and Plant Health Fields
* AD HOC - PROCEDURES APPLICABLES ARRANG. PAYS TIERS VETERINAIRE ET PHYTOSANITAIRE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PAYS TIERS") /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode = "H44" if wpname == "AD HOC - PROCEDURES APPLICABLES ARRANG. PAYS TIERS VETERINAIRE ET PHYTOSANITAIRE"


* Ad hoc Working Party on Genetically Modified Organisms (GMO)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GENET") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H45" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GENET")
*groups wpname if wpcode == "H45", order(h) miss

**groups wpname if wpcode != "H45" & wpcode != "Z00" /*
	*/ & regex(wpname, "GENET") /*
	*/ , order(h) show(freq Freq)

	
* Make corrections
replace wpcode = "H18" if wpname == "AGRI - QUESTIONS HORIZONTALES: AGENDA 2000"
replace wpcode = "H23" if wpname == "CONSEILLERS / ATTACHES AGRI (PHYTO.)"
replace wpcode = "H07e" if wpname == "CONSEILLERS / ATTACHES AGRI (RESIDUS PESCTICDES)"
replace wpcode = "H32" if wpname == "CONSEILLERS / ATTACHES AGRI (VETERINAIRES)"
replace wpcode = "H32" if wpname == "CONSEILLERS ATTACHES AGRI \(VETERINAIRES\)"


* Additional coding
* Bird flue
replace wpcode = "H00" if wpname == "ATTACHES GRIPPE AVIAIRE"


* Counsellors
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRI") /*
	*/ & regex(wpname, "(ATT)|(CONSEILL)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H46" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRI") /*
	*/ & regex(wpname, "(ATT)|(CONSEILL)")
*groups wpname if wpcode == "H46", order(h) miss

**groups wpname if wpcode != "H45" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRI") /*
	*/ & regex(wpname, "(ATT)|(CONSEILL)") /*
	*/ , order(h) show(freq Freq)
	
* Make corrections
replace wpcode2 = "H46" if wpname == "CHEFS SERVICES VETERINAIRES + ATTACHES AGRI"
replace wpcode2 = "H46" if wpname == "CONJOINT MASHRAK / MAGHREB / ATTACHES AGRI"
	

* Foodstuff safety
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SEC.*ALIM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SEC.*ALIM")
*groups wpname if wpcode == "H00", order(h) miss

*groups wpname if wpcode != "H00" & wpcode != "Z00" /*
	*/ & regex(wpname, "SEC.*ALIM") /*
	*/ , order(h) show(freq Freq)

*groups wpname if wpcode != "H00" & wpcode != "Z00" /*
	*/ & regex(wpname, "SEC.*ALIM") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "H00" if wpcode != "H00" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "SEC.*ALIM")
*groups wpname if wpcode2 == "H00", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "H00" & wpcode2 != "H00" & wpcode != "Z00" /*
	*/ & regex(wpname, "SEC.*ALIM") /*
	*/ , order(h) show(freq Freq)
	
	
* Remaining AGRI meetings (mostly Attachees)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRI") /*
	*/ & regex(wpname, "(CONF)|(MEDIT)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AGRI") /*
	*/ & regex(wpname, "(CONF)|(MEDIT)") == 0
*groups wpname if wpcode == "H00", order(h) miss

* Make corrections
replace wpcode2 = "Z00" if wpname == "INFORMELLE MIN. AGRI"


* Fisheries
***********

* Working Party on External Fisheries Policy
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & (regex(wpname, "(PECHE.*EXT)|(EXT.*PECHE)") /*
	*/ | regex(wpname, "COORDINATION.*PECHE")) /*
	*/ , order(h) show(freq Freq)
replace wpcode = "I01" if wpcode == "" & wpcode != "Z00" /*
	*/ & (regex(wpname, "(PECHE.*EXT)|(EXT.*PECHE)") /*
	*/ | regex(wpname, "COORDINATION.*PECHE"))
*groups wpname if wpcode == "I01", order(h) miss

**groups wpname if wpcode != "I01" & wpcode != "Z00" /*
	*/ & (regexm(wpname, "(PECHE.*EXT)|(EXT.*PECHE)") /*
	*/ | regex(wpname, "COORDINATION.*PECHE")) /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Internal Fisheries Policy
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(PECHE.*INT)|(INT.*PECHE)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "I02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(PECHE.*INT)|(INT.*PECHE)")
*groups wpname if wpcode == "I02", order(h) miss

*groups wpname if wpcode != "I02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(PECHE.*INT)|(INT.*PECHE)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "I02" if wpcode != "I02" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(PECHE.*INT)|(INT.*PECHE)")
*groups wpname if wpcode2 == "I02", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "I02" & wpcode2 != "I02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(PECHE.*INT)|(INT.*PECHE)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party of Director-General of Fisheries Departments
* DIRECTEURS GENERAUX DE LA PECHE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GEN.*PECHE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "I03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GEN.*PECHE")
*groups wpname if wpcode == "I03", order(h) miss

**groups wpname if wpcode != "I03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "GEN.*PECHE") /*
	*/ , order(h) show(freq Freq)
	

* Fisheries Attachees
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((CONSEILLERS)|(ATTACHES)).*P[E�]CHE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "I04" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((CONSEILLERS)|(ATTACHES)).*P[E�]CHE")
*groups wpname if wpcode == "I04", order(h) miss

**groups wpname if wpcode != "I04" & wpcode != "Z00" /*
	*/ & regexm(wpname, "((CONSEILLERS)|(ATTACHES)).*P[E�]CHE") /*
	*/ , order(h) show(freq Freq)

* Make corrections
replace wpcode2 = "I04" if wpname == "CONSEILLERS / ATTACHES AGRI - PECHE"
	

* Industry
**********
	
* Working Party on Industry: State Aid
* AIDES D'ETAT
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AIDES") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "J01a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AIDES")
*groups wpname if wpcode == "J01a", order(h) miss

**groups wpname if wpcode != "J01a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AIDES") /*
	*/ , order(h) show(freq Freq)


* Working Party on Industry: Shipbuilding
* CONSTRUCTION NAVALE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "NAVAL") /*
	*/ & regex(wpname, "COMPETITIVITE") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "J01b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "NAVAL") /*
	*/ & regex(wpname, "COMPETITIVITE") == 0
*groups wpname if wpcode == "J01b", order(h) miss

*groups wpname if wpcode != "J01b" & wpcode != "Z00" /*
	*/ & regex(wpname, "NAVAL") /*
	*/ & regex(wpname, "COMPETITIVITE") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "J01b" if wpcode != "J01b" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "NAVAL") /*
	*/ & regex(wpname, "COMPETITIVITE") == 0
*groups wpname if wpcode2 == "J01b", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "J01b" & wpcode2 != "J01b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "") /*
	*/ , order(h) show(freq Freq)

* Correction
replace wpcode = "Z00" if wpname == "NAVAL EXPERTS CONF."

* Working Party on Industry: SMEs, including Late Payments
* PME, Y COMPRIS RETARDS DE PAIEMENT
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "( PME)|(PAIEMENT)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "J01c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "( PME)|(PAIEMENT)")	
*groups wpname if wpcode == "J01c", order(h) miss

*groups wpname if wpcode != "J01c" & wpcode != "Z00" /*
	*/ & regex(wpname, "( PME)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "J01c" if wpcode != "J01c" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "( PME)")
*groups wpname if wpcode2 == "J01c", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "J01c" & wpcode2 != "J01c" & wpcode != "Z00" /*
	*/ & regex(wpname, "( PME)") /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode = "J01c" if wpname == "QUESTIONS ECO. P.M.E."

	
* Working Party on Industry
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "INDUSTRIE") /*
	*/ & regex(wpname, "COMP") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "J01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "INDUSTRIE") /*
	*/ & regex(wpname, "COMP") == 0
*groups wpname if wpcode == "J01", order(h) miss
	
**groups wpname if wpcode != "J01" & regexm(wpcode, "J01") == 0 & wpcode != "Z00" /*
	*/ & regex(wpname, "INDUSTRIE") /*
	*/ & regex(wpname, "COMP") == 0 /*
	*/ , order(h) show(freq Freq)

* Make correction
replace wpcode = "J01" if wpname == "GROUPE INDUSTRIE (EXPERTS QUESTIONS COMMERC.)"
	

* Working Party on Competition
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CONCURRENCE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "J02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CONCURRENCE")
*groups wpname if wpcode == "J02", order(h) miss

**groups wpname if wpcode != "J02" & wpcode != "Z00" /*
	*/ & regex(wpname, "CONCURRENCE") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on ECSC Questions
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CECA") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "J03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CECA")
*groups wpname if wpcode == "J03", order(h) miss

*groups wpname if wpcode != "J03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CECA") /*
	*/ & regexm(wpname, "1[13]3") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "J03" if wpcode != "J03" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "CECA") /*
	*/ & regexm(wpname, "1[13]3") == 0
*groups wpname if wpcode2 == "J03", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "J03" & wpcode2 != "J03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CECA") /*
	*/ & regexm(wpname, "1[13]3") == 0 /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Tourism
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COMP") == 0 /*
	*/ & regex(wpname, "TOURISME") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "J04" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COMP") == 0 /*
	*/ & regex(wpname, "TOURISME")
*groups wpname if wpcode == "J04", order(h) miss

**groups wpname if wpcode != "J04" & wpcode != "Z00" /*
	*/ & regex(wpname, "COMP") == 0 /*
	*/ & regex(wpname, "TOURISME") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on European Space Policy
* Part of Competitiveness Council, but would probably been part of Industry formation before
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ESPACE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "J05" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ESPACE")
*groups wpname if wpcode == "J05", order(h) miss

**groups wpname if wpcode != "J05" & wpcode != "Z00" /*
	*/ & regex(wpname, "ESPACE") /*
	*/ , order(h) show(freq Freq)


* Internal Market
*****************

* Working Party on the Internal Market (Horizontal Questions)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(M\.I)|(MARCH.*INT)") /*
	*/ & regex(wpname, "(COMPETITIVITE)|(A\.M\.I)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(M\.I)|(MARCH.*INT)") /*
	*/ & regex(wpname, "(COMPETITIVITE)|(A\.M\.I)") == 0
*groups wpname if wpcode == "K01", order(h) miss

**groups wpname if wpcode != "K01" & wpcode != "Z00" /*
	*/ & regex(wpname, "(M\.I)|(MARCH.*INT)") /*
	*/ & regex(wpname, "(COMPETITIVITE)|(A\.M\.I)") == 0 /*
	*/ , order(h) show(freq Freq)

* Make correction
replace wpcode = "" if wpname == "MARCHE INTERIEUR - STATISTIQUES"	
	
	
* Working Party on Public Procurement
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MARCHE.*PUBLI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MARCHE.*PUBLI")
*groups wpname if wpcode == "K02", order(h) miss

**groups wpname if wpcode != "K02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MARCHE.*PUBLI") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Statistics: Intrastat
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "INTRASTAT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K03a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "INTRASTAT")
*groups wpname if wpcode == "K03a", order(h) miss

**groups wpname if wpcode != "K03a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "INTRASTAT") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Statistics: Waste Statistics
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "STAT.*DECHET") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K03b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "STAT.*DECHET")
*groups wpname if wpcode == "K03b", order(h) miss

**groups wpname if wpcode != "K03b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "STAT.*DECHET") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Statistics: Electronic Data Interchange on Commerce (EDICOM)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EDICOM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K03c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EDICOM")
*groups wpname if wpcode == "K03c", order(h) miss

**groups wpname if wpcode != "K03c" & wpcode != "Z00" /*
	*/ & regexm(wpname, "EDICOM") /*
	*/ , order(h) show(freq Freq)


* Working Party on Statistics: Nomenclature of territorial units for statistics (NUTS)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "NUTS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K03d" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "NUTS")
*groups wpname if wpcode == "K03d", order(h) miss

**groups wpname if wpcode != "K03d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "NUTS") /*
	*/ , order(h) show(freq Freq)


* Working Party on Statistics
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ECO.*STATISTI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ECO.*STATISTI")
*groups wpname if wpcode == "K03", order(h) miss

**groups wpname if wpcode != "K03" & regexm(wpcode, "K03") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "ECO.*STATISTI") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Intellectual Property: Trade Marks
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MARQUE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K04a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MARQUE")
*groups wpname if wpcode == "K04a", order(h) miss

**groups wpname if wpcode != "K04a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MARQUE") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Intellectual Property: Utility Models
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "UTILITE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K04b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "UTILITE")
*groups wpname if wpcode == "K04b", order(h) miss

**groups wpname if wpcode != "K04b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "UTILITE") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Intellectual Property: Design
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DESSINS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K04c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DESSINS")
*groups wpname if wpcode == "K04c", order(h) miss

**groups wpname if wpcode != "K04c" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DESSINS") /*
	*/ , order(h) show(freq Freq)


* Working Party on Intellectual Property: Patents
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BREVET") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K04d" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BREVET")
*groups wpname if wpcode == "K04d", order(h) miss

**groups wpname if wpcode != "K04d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "BREVET") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Intellectual Property: Copyright
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AUTEUR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K04e" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AUTEUR")
*groups wpname if wpcode == "K04e", order(h) miss

**groups wpname if wpcode != "K04e" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AUTEUR") /*
	*/ , order(h) show(freq Freq)


* Working Party on Intellectual Property: Design (II)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DESSINS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K04f" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DESSINS")
*groups wpname if wpcode == "K04f", order(h) miss

*groups wpname if wpcode != "K04f" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DESSINS") /*
	*/ , order(h) show(freq Freq)
list date wpcode wpname if wpcode != "K04f" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DESSINS")
	
* Make corrections
replace wpcode = "K04f" if wpcode != "K04f" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DESSINS") & date >= d(27jun2005)
	
	
* Working Party on Intellectual Property: Trade Marks (II)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MARQUE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K04g" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MARQUE")
*groups wpname if wpcode == "K04g", order(h) miss

*groups wpname if wpcode != "K04g" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MARQUE") /*
	*/ , order(h) show(freq Freq)
list date wpcode wpname if wpcode != "K04g" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DESSINS")
* No observations	
	
	
* Working Party on Intellectual Property: Enforcement
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(APPLICATION)|(ENFORCEMENT)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K04h" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(APPLICATION)|(ENFORCEMENT)")
*groups wpname if wpcode == "K04h", order(h) miss

*groups wpname if wpcode != "K04h" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(APPLICATION)|(ENFORCEMENT)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Intellectual Property: Trade Secrets
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SECRET") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K04i" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SECRET")
*groups wpname if wpcode == "K04i", order(h) miss

*groups wpname if wpcode != "K04i" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SECRET") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Intellectual Property
groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(P\.I)|(PROP.*INTELL)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K04" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(P\.I)|(PROP.*INTELL)")
*groups wpname if wpcode == "K04", order(h) miss

**groups wpname if wpcode != "K04" & regexm(wpcode, "K04") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "(P\.I)|(PROP.*INTELL)") /*
	*/ , order(h) show(freq Freq)

* Make correction
replace wpcode = "K04" if wpname == "ATTACHES PROPRIETE INTELLECTUELLE (PROP. INDUSTRIELLE)"
	

* Working Party on Company Law: Accounting and Statutory Auditing
*COMPTABILITE ET CONTROLE LEGAL DES DOCUMENTS COMPTABLES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COMPT)|(ACCOUNT)|(AUDIT)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COMPT)|(ACCOUNT)|(AUDIT)")
*groups wpname if wpcode == "K05a", order(h) miss

**groups wpname if wpcode != "K05a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COMPT)|(ACCOUNT)|(AUDIT)") /*
	*/ , order(h) show(freq Freq)
	
* Make corrections
replace wpcode = "" if wpname == "GROUPE AVIATION (AUDITIONS)"
replace wpcode = "K05a" if wpname == "ATTACHES SERVICES FINANCIERS (AUDITING)"
replace wpcode = "K05a" if wpname == "ATTACHES SERVICES FINANCIERS (COMP. ET CONTROLE LEGAL DOC. COMPT.)"
replace wpcode = "K05a" if wpname == "CONSEILLERS FINANCIERS (AUDIT)"


* Working Party on Company Law: Takeover Bids
* OFFRES PUBLIQUES D'ACQUISITION
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(OPA)|(OFFRE.*PUBLI)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(OPA)|(OFFRE.*PUBLI)")
*groups wpname if wpcode == "K05b", order(h) miss

**groups wpname if wpcode != "K05b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(OPA)|(OFFRE.*PUBLI)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Company Law: Ad hoc European Company
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SOCIETE EUR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SOCIETE EUR")
*groups wpname if wpcode == "K05c", order(h) miss

**groups wpname if wpcode != "K05c" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SOCIETE EUR") /*
	*/ , order(h) show(freq Freq)


* Working Party on Company Law: European Co-operative Society
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SOC.*COOP.*EUR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05d" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SOC.*COOP.*EUR")
*groups wpname if wpcode == "K05d", order(h) miss

**groups wpname if wpcode != "K05d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SOC.*COOP.*EUR") /*
	*/ , order(h) show(freq Freq)


* Working Party on Company Law: European Association
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ASS.*EUROP") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05e" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ASS.*EUROP")
*groups wpname if wpcode == "K05e", order(h) miss

**groups wpname if wpcode != "K05e" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ASS.*EUROP") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Company Law: Acquisition of Holdings
* Prises de participation
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(PRISES)|(PARTIC)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05f" if wpcode == "" /*
	*/ & regexm(wpname, "PARTIC")
*groups wpname if wpcode == "K05f", order(h) miss
	
*groups wpname if wpcode != "K05f" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(PRISES)|(PARTIC)") /*
	*/ , order(h) show(freq Freq)
* No observations


* Working Party on Company Law: First Directive
* PREMIERE DIRECTIVE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PREM.*DIR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05g" if wpcode == "" /*
	*/ & regexm(wpname, "PREM.*DIR")
*groups wpname if wpcode == "K05g", order(h) miss
	
*groups wpname if wpcode != "K05g" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PREM.*DIR") /*
	*/ , order(h) show(freq Freq)
* No observations
	

* Working Party on Company Law: Corporate Governance
* Gouvernement d�entreprise
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENTREP") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05h" if wpcode == "" /*
	*/ & regexm(wpname, "GOUV.*ENTREP")
*groups wpname if wpcode == "K05h", order(h) miss
	
*groups wpname if wpcode != "K05h" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ENTREP") /*
	*/ , order(h) show(freq Freq)
* No observations

	
* Working Party on Company Law: Takeover Bids (II)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(OPA)|(OFFRE.*PUBLI)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05i" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(OPA)|(OFFRE.*PUBLI)")
*groups wpname if wpcode == "K05i", order(h) miss

*groups wpname if wpcode != "K05i" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(OPA)|(OFFRE.*PUBLI)") /*
	*/ , order(h) show(freq Freq)
list date wpcode wpname if wpcode != "K05i" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(OPA)|(OFFRE.*PUBLI)")
	
* Make corrections
replace wpcode = "K05i" if wpcode != "K05i" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(OPA)|(OFFRE.*PUBLI)") & date >= d(30oct2001)


* Working Party on Company Law: Cross-Border Mergers
* Fusions transfrontali�res
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FUSION") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05j" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FUSION")
*groups wpname if wpcode == "K05j", order(h) miss

*groups wpname if wpcode != "K05j" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FUSION") /*
	*/ , order(h) show(freq Freq)	
	
	
* Working Party on Company Law: Second Directive
* Deuxi�me directive
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "2.*DIR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05k" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "2.*DIR")
*groups wpname if wpcode == "K05k", order(h) miss

*groups wpname if wpcode != "K05k" & wpcode != "Z00" /*
	*/ & regexm(wpname, "2.*DIR") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Company Law: Shareholders' Rights
* Droits des actionnaires
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ACTIONNAIRE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05l" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ACTIONNAIRE")
*groups wpname if wpcode == "K05l", order(h) miss

*groups wpname if wpcode != "K05l" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ACTIONNAIRE") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Company Law
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DR.*SOC") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K05" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DR.*SOC")
*groups wpname if wpcode == "K05", order(h) miss

* Make correction
replace wpcode = "K05" if wpname == "ATTACHES FINANCIERS (DROIT SOCIETES)"

*groups wpname if wpcode != "K05" & regexm(wpcode, "K05") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "DR.*SOCIETE") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "K05" if wpcode != "K05" & regexm(wpcode, "K05") == 0 & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "DR.*SOCIETE")
*groups wpname if wpcode2 == "K05", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "K05" & wpcode2 != "K05" & regexm(wpcode, "K05") == 0 /*
	*/ & regexm(wpcode2, "K05") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "DR.*SOCIETE") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Insurance
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ASSUR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K06" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ASSUR")
*groups wpname if wpcode == "K06", order(h) miss

**groups wpname if wpcode != "K06" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ASSUR") /*
	*/ , order(h) show(freq Freq)

* Make correction
replace wpcode = "Z00" if wpname == "COMITE DE GESTION ASSURANCE MALADIE"	
	

* Working Party on Rights of Establishment and Services: Diplomas
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DIPLOMES") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K07a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DIPLOMES")
*groups wpname if wpcode == "K07a", order(h) miss

**groups wpname if wpcode != "K07a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DIPLOMES") /*
	*/ , order(h) show(freq Freq)


* Working Party on Rights of Establishment and Services: Establishment and Services (Third Country Nationals)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RES.*TIERS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K07b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RES.*TIERS")
*groups wpname if wpcode == "K07b", order(h) miss

**groups wpname if wpcode != "K07b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "RES.*TIERS") /*
	*/ , order(h) show(freq Freq)


* Working Party on Rights of Establishment and Services
* ETABLISSEMENT ET SERVICES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ETAB") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K07" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ETAB")
*groups wpname if wpcode == "K07", order(h) miss

**groups wpname if wpcode != "K07" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ETAB") /*
	*/ , order(h) show(freq Freq)
	
replace wpcode = "K07" if wpname == "QUESTIONS ECO. - ETS. ET SERVICES"


* Working Party on Technical Harmonisation: Standardisation
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "NORMALISATION") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "NORMALISATION")
*groups wpname if wpcode == "K08a", order(h) miss

**groups wpname if wpcode != "K08a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "NORMALISATION") /*
	*/ , order(h) show(freq Freq)


* Working Party on Technical Harmonisation: Motor Vehicles (Internal Market)
* VEHICULES A MOTEUR
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MOTEUR") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MOTEUR")
*groups wpname if wpcode == "K08b", order(h) miss

*groups wpname if wpcode != "K08b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MOTEUR") /*
	*/ & regexm(wpname, "(\+)|(\/)|(ET)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "K08b" if wpcode != "K08b" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "MOTEUR") /*
	*/ & regexm(wpname, "(\+)|(\/)|(ET)")
*groups wpname if wpcode2 == "K08b", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "K08b" & wpcode2 != "K08b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MOTEUR") /*
	*/ & regexm(wpname, "(\+)|(\/)|(ET)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Technical Harmonisation: Dangerous Substances and Preparations
* SUBSTANCES ET PREPARATIONS DANGEREUSES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((SUBST)|(PREP)).*DANGER") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((SUBST)|(PREP)).*DANGER")
*groups wpname if wpcode == "K08c", order(h) miss

**groups wpname if wpcode != "K08c" & wpcode != "Z00" /*
	*/ & regex(wpname, "((SUBST)|(PREP)).*DANGER") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Technical Harmonisation: Machinery
* MACHINES, EQUIPEMENTS ELECTRIQUES ET AUTRES PRODUITS
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MACHINES") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08d" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MACHINES")
*groups wpname if wpcode == "K08d", order(h) miss

*groups wpname if wpcode != "K08d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MACHINES") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "K08d" if wpcode != "K08d" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "MACHINES")
*groups wpname if wpcode2 == "K08d", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "K08d" & wpcode2 != "K08d" & wpcode != "Z00" /*
	*/ & regexm(wpname, "MACHINES") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Technical Harmonisation: Precious Metals
* METAUX PRECIEUX
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	* */ & regex(wpname, "METAUX") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08e" if wpcode == "" & wpcode != "Z00" /*
	* */ & regex(wpname, "METAUX")
*groups wpname if wpcode == "K08e", order(h) miss

**groups wpname if wpcode != "K08e" & wpcode != "Z00" /*
	*/ & regexm(wpname, "METAUX") /*
	*/ , order(h) show(freq Freq)


* Working Party on Technical Harmonisation: Fertilizers
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENGRAI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08f" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENGRAI")
*groups wpname if wpcode == "K08f", order(h) miss

*groups wpname if wpcode != "K08f" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ENGRAI") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Technical Harmonisation: Construction Products
* PRODUITS DE CONSTRUCTION
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, " CONSTRUCTION") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08g" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, " CONSTRUCTION")
*groups wpname if wpcode == "K08g", order(h) miss

**groups wpname if wpcode != "K08g" & wpcode != "Z00" /*
	*/ & regexm(wpname, " CONSTRUCTION") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Technical Harmonisation: Electrical Equipment and Other Products
* EQUIPEMENTS ELECTRIQUES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ELECT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08h" if wpcode == "" /*
	*/ & regexm(wpname, "ELECTRIQUE")
*groups wpname if wpcode == "K08h", order(h) miss
	
*groups wpname if wpcode != "K08h" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ELECT") /*
	*/ , order(h) show(freq Freq)	
* No observations
	
	
* Working Party on Technical Harmonisation: Cosmetics
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COSMETIQUES") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08i" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COSMETIQUES")
*groups wpname if wpcode == "K08i", order(h) miss

**groups wpname if wpcode != "K08i" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COSMETIQUES") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Technical Harmonisation: Instruments
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "INSTRUMENTS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08j" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "INSTRUMENTS")
*groups wpname if wpcode == "K08j", order(h) miss

**groups wpname if wpcode != "K08j" & wpcode != "Z00" /*
	*/ & regexm(wpname, "INSTRUMENTS") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Technical Harmonisation: Recreational Craft
* Bateaux de plaisance
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PLAIS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08k" if wpcode == "" /*
	*/ & regexm(wpname, "PLAIS")
*groups wpname if wpcode == "K08k", order(h) miss
	
*groups wpname if wpcode != "K08k" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PLAIS") /*
	*/ , order(h) show(freq Freq)	
* No observations

* Working Party on Technical Harmonisation: Weight Range
* Gamme des poids
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "POIDS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08l" if wpcode == "" /*
	*/ & regexm(wpname, "POIDS")
*groups wpname if wpcode == "K08l", order(h) miss
	
*groups wpname if wpcode != "K08l" & wpcode != "Z00" /*
	*/ & regexm(wpname, "POIDS") /*
	*/ , order(h) show(freq Freq)	
* No observations
	

* Working Party on Technical Harmonisation: Cosmetics (II)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COSMETIQUES") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08m" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COSMETIQUES")
*groups wpname if wpcode == "K08m", order(h) miss

*groups wpname if wpcode != "K08m" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COSMETIQUES") /*
	*/ , order(h) show(freq Freq)
*list date wpcode wpname if wpcode != "K08m" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COSMETIQUES")
	
* Make corrections
replace wpcode = "K08m" if wpcode != "K08m" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COSMETIQUES") & date > d(24apr2006)

	
* Working Party on Technical Harmonisation: Toys
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "JOUETS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08n" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "JOUETS")
*groups wpname if wpcode == "K08n", order(h) miss

**groups wpname if wpcode != "K08n" & wpcode != "Z00" /*
	*/ & regexm(wpname, "JOUETS") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Technical Harmonisation: Construction Products (II)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, " CONSTRUCTION") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08o" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, " CONSTRUCTION")
*groups wpname if wpcode == "K08o", order(h) miss

*groups wpname if wpcode != "K08o" & wpcode != "Z00" /*
	*/ & regexm(wpname, " CONSTRUCTION") /*
	*/ , order(h) show(freq Freq)
list date wpcode wpname if wpcode != "K08o" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CONSTRUCTION")
	
* Make corrections
replace wpcode = "K08o" if wpcode != "K08o" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CONSTRUCTION") & date > d(08jul2008)
	

* Working Party on Technical Harmonisation: Motor Vehicles (International)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(VEHIC)|(MOTEUR)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08p" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "MOTEUR")
*groups wpname if wpcode == "K08p", order(h) miss

*groups wpname if wpcode != "K08p" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(VEHIC)|(MOTEUR)") & date >= d(16jan2001) /*
	*/ , order(h) show(freq Freq)
* No observations
	

* Working Party on Technical Harmonisation: Dangerous Substances
* ('reborn' successor of K08c; code corrected as part of cross-validation with lifecycle data
* K08q


* Working Party on Technical Harmonisation: New Legal Framework
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "NOUVEAU CADRE JURIDIQUE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08r" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "NOUVEAU CADRE JURIDIQUE")
*groups wpname if wpcode == "K08r", order(h) miss

*groups wpname if wpcode != "K08r" & wpcode != "Z00" /*
	*/ & regexm(wpname, "NOUVEAU CADRE JURIDIQUE") & wpcode != "Z00" /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Technical Harmonisation: Recreational Craft (II)
* ('reborn' successor of K08k; code corrected as part of cross-validation with lifecycle data
* K08s


* Working Party on Technical Harmonisation: Radio Equipment
groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RADIO") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08t" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RADIO")
*groups wpname if wpcode == "K08t", order(h) miss

*groups wpname if wpcode != "K08t" & wpcode != "Z00" /*
	*/ & regexm(wpname, "RADIO") & wpcode != "Z00" /*
	*/ , order(h) show(freq Freq)


* Working Party on Technical Harmonisation: Pressure Equipment
groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PRESSION") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08u" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PRESSION")
*groups wpname if wpcode == "K08u", order(h) miss

*groups wpname if wpcode != "K08u" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PRESSION") & wpcode != "Z00" /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Technical Harmonisation
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HARMONISATION") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K08" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HARMONISATION")
*groups wpname if wpcode == "K08", order(h) miss

**groups wpname if wpcode != "K08" & regexm(wpcode, "K08") == 0 & wpcode != "Z00" /*
	*/ & regex(wpname, "HARMONISATION") /*
	*/ , order(h) show(freq Freq)

* Make corrections
replace wpcode2 = "K08" if wpname == "HARMONISATION TECHNIQUE: VEHICULES A MOTEUR / MARCHE INTERIEUR"
replace wpcode = "K08a" if wpname == "HARMONISATION TECHNIQUE - NORM."


* Working Party on Liability for Defective Products
* Responsabilit� du fait des produits d�fectueux
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DEFECT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K09" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DEFECT")
*groups wpname if wpcode == "K09", order(h) miss

**groups wpname if wpcode != "K09" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DEFECT") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Pharmaceuticals and Medical Devices: Orphan Medicinal Products
* MEDICAMENTS ORPHELINS
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ORPHELINS") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K10a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ORPHELINS")
*groups wpname if wpcode == "K10a", order(h) miss

**groups wpname if wpcode != "K10a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ORPHELINS") /*
	*/ , order(h) show(freq Freq)


* Working Party on Pharmaceuticals and Medical Devices: Clinical Trials
*ESSAIS CLINIQUES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ESSAI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K10b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ESSAI")
*groups wpname if wpcode == "K10b", order(h) miss

**groups wpname if wpcode != "K10b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ESSAI") /*
	*/ , order(h) show(freq Freq)
	
replace wpcode = "K10b" if wpname == "QUESTIONS ECO (Essais cliniques)"


* Working Party on Pharmaceuticals and Medical Devices: Medical Devices
*DISPOSITIFS MEDICAUX
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DISP") /*
	*/ & regex(wpname, "PHARM") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K10c" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DISP") /*
	*/ & regex(wpname, "PHARM") == 0
*groups wpname if wpcode == "K10c", order(h) miss

**groups wpname if wpcode != "K10c" & wpcode != "Z00" /*
	*/ & regex(wpname, "DISP") /*
	*/ & regex(wpname, "PHARM") == 0 /*
	*/ , order(h) show(freq Freq)


* Working Party on Pharmaceuticals and Medical Devices
*PRODUITS PHARMACEUTIQUES ET DISPOSITIFS MEDICAUX
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(PROD.* PHARM)|(DISP.*MED)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K10" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(PROD.* PHARM)|(DISP.*MED)")
*groups wpname if wpcode == "K10", order(h) miss

**groups wpname if wpcode != "K10" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(PROD.* PHARM)|(DISP.*MED)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Customs Union: Customs Legislation and Policy
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "LEG.*POL") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K11a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "LEG.*POL")
*groups wpname if wpcode == "K11a", order(h) miss

*groups wpname if wpcode != "K11a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "LEG.*POL") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "K11a" if wpcode != "K11a" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "LEG.*POL")
*groups wpname if wpcode2 == "K11a", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "K11a" & wpcode2 != "K11a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "LEG.*POL") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Customs Union: Common Customs Tariff
* TARIF DOUANIER COMMUN
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(TDC)|(DOUAN.*COMM)|(TARIF)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K11b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(TDC)|(DOUAN.*COMM)|(TARIF)")
*groups wpname if wpcode == "K11b", order(h) miss

*groups wpname if wpcode != "K11b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(TDC)|(DOUAN.*COMM)|(TARIF)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "K11b" if wpcode != "K11b" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(TDC)|(DOUAN.*COMM)|(TARIF)")
*groups wpname if wpcode2 == "K11b", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "K11b" & wpcode2 != "K11b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(TDC)|(DOUAN.*COMM)|(TARIF)") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Customs Union
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "UNION DOUANIER") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K11" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "UNION DOUANIER")
*groups wpname if wpcode == "K11", order(h) miss

**groups wpname if wpcode != "K11" & regexm(wpcode, "K11") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "UNION DOUANIER") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "K11" if regexm(wpcode, "K11") == 0 & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "UNION DOUANIER")

**
replace wpcode = "K11" if regexm(wpname, "CUSTOM UNION")


* Working Party on Data Protection
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROT.*DONNE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K12" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROT.*DONNE")
*groups wpname if wpcode == "K12", order(h) miss

*groups wpname if wpcode != "K12" & wpcode != "G09" & wpcode != "G29" & wpcode != "G09" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PROT.*DONNE") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "K12" if wpcode != "K12" & wpcode != "G09" & wpcode != "G29" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "PROT.*DONNE")
*groups wpname if wpcode2 == "K12", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "K12" & wpcode2 != "K12" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PROT.*DONNE") /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Foodstuffs
* DENREES ALIMENTAIRES
groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DENR.*ALIM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K13" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DENR.*ALIM")
*groups wpname if wpcode == "K13", order(h) miss

* Make corrections
replace wpcode = "K13" if wpname == "CONSEILLERS / ATTACHES AGRI (DENREES ALIM.)"
replace wpcode = "K13" if wpname == "ATTACHES AGRI / DENREES ALIMENTAIRES"

*groups wpname if wpcode != "K13" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DENR.*ALIM") /*
	*/ & regexm(wpname, "CODEX") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "K13" if wpcode != "K13" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "DENR.*ALIM") /*
	*/ & regexm(wpname, "CODEX") == 0
*groups wpname if wpcode2 == "K13", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "K13" & wpcode2 != "K13" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DENR.*ALIM") /*
	*/ & regexm(wpname, "CODEX") == 0 /*
	*/ , order(h) show(freq Freq)
	

* Working Party on Free Movement of Persons
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CIRC") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K14" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CIRC")
*groups wpname if wpcode == "K14", order(h) miss

**groups wpname if wpcode != "K14" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CIRC") /*
	*/ , order(h) show(freq Freq)


* Working Party on Competitiveness and Growth
groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COMPETITIV)|(CROIS)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K15" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(COMPETITIV)|(CROIS)")
*groups wpname if wpcode == "K15", order(h) miss

*groups wpname if wpcode != "K15" & wpcode != "F13" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COMPETITIV)|(CROIS)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "K15" if wpcode != "K15" & wpcode != "F13" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(COMPETITIV)|(CROIS)")
*groups wpname if wpcode2 == "K15", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "K15" & wpcode2 != "K15" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(COMPETITIV)|(CROIS)") /*
	*/ , order(h) show(freq Freq)

	
* Ad hoc Working Party on Chemicals
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PRODUITS CHIMIQUES") /*
	*/ & regex(wpname, "OCDE") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K16" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PRODUITS CHIMIQUES") /*
	*/ & regex(wpname, "OCDE") == 0
*groups wpname if wpcode == "K16", order(h) miss
	
**groups wpname if wpcode != "K16" & wpcode != "Z00" /*
	*/ & regex(wpname, "PRODUITS CHIMIQUES") /*
	*/ & regex(wpname, "OCDE") == 0 /*
	*/ , order(h) show(freq Freq)

* Correction
replace wpcode = "" if wpcode == "K16" & regexm(wpname, "ENV.* INT")


* High Level Working Group on Competitiveness and Growth
* Seems to be a formalization of one of the formations of K15
* Only a single meeting so far
replace wpcode = "K17" if wpcode == "K15" & wpname == "COMPETITIVITE ET CROISSANCE (HAUT NIVEAU)" & date > d(31/10/2014)	
	
	
* Pre-1999 Working parties
**************************

* In-vitro diagnostics
* DIAGNOSTIQUE IN VITRO	
* Possibly sub-group of K10 Medical Devices
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VITRO") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VITRO")
*groups wpname if wpcode == "K00", order(h) miss

**groups wpname if wpcode != "K00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "VITRO") /*
	*/ , order(h) show(freq Freq)


* MEDICAMENTS A USAGE HUMAIN	
* Possibly sub-group of K10 Medical Devices
*list date if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HUMAIN")
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HUMAIN") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HUMAIN")
*groups wpname if wpcode == "K00", order(h) miss

**groups wpname if wpcode != "K00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "VITRO") /*
	*/ , order(h) show(freq Freq)
	

* WP on Pressure Equipment
* EQUIPEMENTS SOUS PRESSION
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EQUIPEMENTS SOUS PRESSION") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EQUIPEMENTS SOUS PRESSION")
*groups wpname if wpcode == "K00", order(h) miss

**groups wpname if wpcode != "K00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "EQUIPEMENTS SOUS PRESSION") /*
	*/ , order(h) show(freq Freq)

	
* WP on cableway installations
* INSTALLATIONS A CABLE
* probably sub-group of K8 Technical Harmonisation
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "INSTALLATIONS A CABLE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "INSTALLATIONS A CABLE")
*groups wpname if wpcode == "K00", order(h) miss

**groups wpname if wpcode != "K00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "INSTALLATIONS A CABLE") /*
	*/ , order(h) show(freq Freq)
	
	
* WP on Adequacy of capital contributions
* ADEQUATION DES FONDS PROPRES
* probably sub-group of company law
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FOND.*PROP") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "FOND.*PROP")
*groups wpname if wpcode == "K00", order(h) miss

**groups wpname if wpcode != "K00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "FOND.*PROP") /*
	*/ , order(h) show(freq Freq)
	

* Barriers to trade
* ATTACHES/ENTRAVES TECHNIQUES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENTRAVES") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENTRAVES")
*groups wpname if wpcode == "K00", order(h) miss

**groups wpname if wpcode != "K00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ENTRAVES") /*
	*/ , order(h) show(freq Freq)


* Telecommunications
********************

	
* Working Party on Telecommunications and Information Society
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TELECOM.* ET .*INFO") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "L03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TELECOM.* ET .*INFO")
*groups wpname if wpcode == "L03", order(h) miss

**groups wpname if wpcode != "L03" & wpcode != "Z00" /*
	*/ & regex(wpname, "TELECOM.* ET .*INFO") /*
	*/ , order(h) show(freq Freq)

replace wpcode = "L03" if wpname == "CONJOINT TELECOMMUNICATIONS / S.S.I."
	
* Working Party on Telecommunications
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TELECOM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "L01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TELECOM")
*groups wpname if wpcode == "L01", order(h) miss

**groups wpname if wpcode != "L01" & wpcode != "L03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "TELECOM") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Postal Services
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "POSTES") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "L02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "POSTES")
*groups wpname if wpcode == "L02", order(h) miss

*groups wpname if wpcode != "L02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "POSTES") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "L02" if wpcode != "L02" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "POSTES")
*groups wpname if wpcode2 == "L02", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "L02" & wpcode2 != "L02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "POSTES") /*
	*/ , order(h) show(freq Freq)

replace wpcode2 = "L02" if wpname == "CONJOINT SERVICES POSTAUX ET TELECOMMUNICATIONS ET SOCIETE DE L'INFORMATION"


* Information Society
*********************

* Working Party on Information Society Services
* SERVICES DE LA SOCIETE DE L'INFORMATION
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SOC.*INFO") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "M01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SOC.*INFO")
*groups wpname if wpcode == "M01", order(h) miss

*groups wpname if wpcode != "M01" & wpcode != "L03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SOC.*INFO") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "M01" if wpcode != "M01" & wpcode != "L03" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "SOC.*INFO")
*groups wpname if wpcode2 == "M01", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "M01" & wpcode2 != "M01" & wpcode != "L03" & wpcode2 != "L03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SOC.*INFO") /*
	*/ , order(h) show(freq Freq)
replace wpcode3 = "M01" if wpcode != "M01" & wpcode2 != "M01" & wpcode != "L03" & wpcode2 != "L03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SOC.*INFO")
*groups wpname if wpcode3 == "M01", order(h) miss show(freq Freq)	
	
replace wpcode = "M01" if wpname == "QUESTIONS ECO (SERVICES INFO)"

	
* Energy
********


* Code European Energy Charter meetings
replace wpcode = "Z00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENERG") /*
	*/ & regex(wpname, "CHART")
replace wpcode = "Z00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENERG") /*
	*/ & regex(wpname, "EFFIC")	
	
	
* High Level Working Party on Energy
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((H\.)|(HAUT)).*ENERG") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "N02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((H\.)|(HAUT)).*ENERG")
*groups wpname if wpcode == "N02", order(h) miss
	
**groups wpname if wpcode != "N02" & wpcode != "Z00" /*
	*/ & regex(wpname, "((H\.)|(HAUT)).*ENERG") /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode = "N02" if wpname == "GROUPE ENERGIE (HAUTS FONCTIONNAIRES)"
replace wpcode = "N02" if wpname == "GROUPE ENERGIE HAUTS FONCTIONNAIRES"

	
* Working Party on Energy
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENERG") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "N01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENERG")
*groups wpname if wpcode == "N01", order(h) miss

*groups wpname if wpcode != "N01" & wpcode != "N02" & wpcode != "F12" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ENERG") /*
	*/ & regexm(wpname, "(FIN)|(FISC)") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "N01" if wpcode != "N01" & wpcode != "N02" & wpcode != "F12" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ENERG") /*
	*/ & regexm(wpname, "(FIN)|(FISC)") == 0
*groups wpname if wpcode2 == "N01", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "N01" & wpcode2 != "N01" & wpcode != "N02" & wpcode != "F12" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ENERG") /*
	*/ & regexm(wpname, "(FIN)|(FISC)") == 0 /*
	*/ , order(h) show(freq Freq)

* Make correction
replace wpcode = "" if wpname == "H.N. ENVIRONNEMENT / DEVELOPPEMENT (EXPERTS ENERGIE)"
replace wpcode = "" if wpname == "PARIS COORDINATION OCDE - AGENCE INTERNATIONAL DE L'ENERGIE"
replace wpcode = "" if wpname == "AD HOC TAXE CO2 / ENERGIE"

	
* Ad hoc Working Group on Sustainability Criteria for Biofuels
* GROUPE AD HOC CRITERES DE DURABILITE
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DURABILITE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "N03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DURABILITE")
*groups wpname if wpcode == "N03", order(h) miss

**groups wpname if wpcode != "N03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DURABILITE") /*
	*/ , order(h) show(freq Freq)

	
**
* Ad hoc Working Group on Indirect Land Use Change (ILUC)
* AD HOC CHANGEMENT INDIRECT DANS L'AFFECTATION DES SOLS
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(AD HOC CHANGEMENT INDIRECT)|(AD HOC.* ILUC)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "N04" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(AD HOC CHANGEMENT INDIRECT)|(AD HOC.* ILUC)")
*groups wpname if wpcode == "N04", order(h) miss

**groups wpname if wpcode != "N04" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(AD HOC CHANGEMENT INDIRECT)|(AD HOC ILUC)") /*
	*/ , order(h) show(freq Freq)

		
* Research
**********

	
* Joint Working Party on Research/Atomic Questions
* GROUPE CONJOINT RECHERCHE/QUESTIONS ATOMIQUES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RECH") /*
	*/ & regex(wpname, "ATO") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "O02" if  wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RECH") /*
	*/ & regex(wpname, "ATO")
*groups wpname if wpcode == "O02", order(h) miss

*groups wpname if wpcode != "O02" & wpcode != "Z00" /*
	*/ & regex(wpname, "RECH") /*
	*/ & regex(wpname, "ATO") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "O02" if wpcode != "O02" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regex(wpname, "RECH") /*
	*/ & regex(wpname, "ATO")
*groups wpname if wpcode2 == "O02", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "O02" & wpcode2 != "O02" & wpcode != "Z00" /*
	*/ & regex(wpname, "RECH") /*
	*/ & regex(wpname, "ATO") /*
	*/ , order(h) show(freq Freq)

**
replace wpcode = "O02" if wpname == "EXPERTS QUESTIONS ATOMIQUES" 
	
* Working Party on Research
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RECHERCHE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "O01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "RECHERCHE")
*groups wpname if wpcode == "O01", order(h) miss

*groups wpname if wpcode != "O01" & wpcode != "Z00" /*
	*/ & (regexm(wpname, "RECH.*RECH") /*
	*/ | regexm(wpname, "RECHERCHE") & regexm(wpname, "ATO") == 0) /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "O01" if wpcode != "O01" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & (regexm(wpname, "RECH.*RECH") /*
	*/ | regexm(wpname, "RECHERCHE") & regexm(wpname, "ATO") == 0)
*groups wpname if wpcode2 == "O01", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "O01" & wpcode2 != "O01" & wpcode != "Z00" /*
	*/ & (regexm(wpname, "RECH.*RECH") /*
	*/ | regexm(wpname, "RECHERCHE") & regexm(wpname, "ATO") == 0) /*
	*/ , order(h) show(freq Freq)
replace wpcode3 = "O01" if wpcode != "O01" & wpcode2 != "O01" & wpcode != "Z00" & wpcode3 == "" /*
	*/ & (regexm(wpname, "RECH.*RECH") /*
	*/ | regexm(wpname, "RECHERCHE") & regexm(wpname, "ATO") == 0)
*groups wpname if wpcode3 == "O01", order(h) miss show(freq Freq)	

	
* CREST (Scientific and Technical Research Committee)
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CREST)|(ERAC)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "O03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(CREST)|(ERAC)")
*groups wpname if wpcode == "O03", order(h) miss

*groups wpname if wpcode != "O03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CREST)|(ERAC)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "O03" if wpcode != "O03" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(CREST)|(ERAC)")
*groups wpname if wpcode2 == "O03", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "O03" & wpcode2 != "O03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(CREST)|(ERAC)") /*
	*/ , order(h) show(freq Freq)

	
* Ad hoc Working Party on the European Institute of Technology (EIT)

**groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EIT") /*
	*/ , order(h) show(freq Freq)
**groups wpname if wpcode == "O04", order(h) miss

*groups wpname if wpcode != "O04" & wpcode != "Z00" /*
	*/ & regexm(wpname, "EIT") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "O04" if wpcode != "O04" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "EIT")
*groups wpname if wpcode2 == "O04", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "O04" & wpcode2 != "O04" & wpcode != "Z00" /*
	*/ & regexm(wpname, "EIT") /*
	*/ , order(h) show(freq Freq)

	

* Social and Employment Policy
******************************

	
* Social Protection Committee
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROT.*SOC") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "P02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROT.*SOC")
*groups wpname if wpcode == "P02", order(h) miss

**groups wpname if wpcode != "P02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PROT.*SOC") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Social Questions
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((QUESTIONS)|(ATTACHES)) SOCIA") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "P01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((QUESTIONS)|(ATTACHES)) SOCIA")
*groups wpname if wpcode == "P01", order(h) miss

*groups wpname if wpcode != "P01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "((QUESTIONS)|(ATTACHES)) SOCIA") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "P01" if wpcode != "P01" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "((QUESTIONS)|(ATTACHES)) SOCIA")
*groups wpname if wpcode2 == "P01", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "P01" & wpcode2 != "P01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "((QUESTIONS)|(ATTACHES)) SOCIA") /*
	*/ , order(h) show(freq Freq)

	
* Transport
***********

	
* Working Party on Transport - Intermodal Questions and Networks
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(QUEST.*INTER)|(INTERMODAL)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "Q04" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(QUEST.*INTER)|(INTERMODAL)")
*groups wpname if wpcode == "Q04", order(h) miss

**groups wpname if wpcode != "Q04" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(QUEST.*INTER)|(INTERMODAL)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Land Transport
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(TR.*TERR)|(TERRESTRES)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "Q01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TR.*TERR|(TERRESTRES)")
*groups wpname if wpcode == "Q01", order(h) miss

*groups wpname if wpcode != "Q01" & wpcode != "Z00" /*
	*/ & regex(wpname, "TR.*TERRESTRES") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "Q01" if wpcode != "Q01" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "TR.*TERRESTRES")
*groups wpname if wpcode2 == "Q01", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "Q01" & wpcode2 != "Q01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "TR.*TERRESTRES") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Shipping
* TRANSPORTS MARITIMES
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(TR.*MAR)|(MARITIME)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "Q02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(TR.*MAR)|(MARITIME)")
*groups wpname if wpcode == "Q02", order(h) miss

*groups wpname if wpcode != "Q02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(TR.*MAR)|(MARITIME)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "Q02" if wpcode != "Q02" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(TR.*MAR)|(MARITIME)")
*groups wpname if wpcode2 == "Q02", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "Q02" & wpcode2 != "Q02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(TR.*MAR)|(MARITIME)") /*
	*/ , order(h) show(freq Freq)
replace wpcode3 = "Q02" if wpcode != "Q02" & wpcode2 != "Q02" & wpcode != "Z00" & wpcode3 == "" /*
	*/ & regexm(wpname, "(TR.*MAR)|(MARITIME)")
*groups wpname if wpcode3 == "Q02", order(h) miss show(freq Freq)	

* Make correction
replace wpcode = "Z00" if wpname == "MARITIME RAPID RESPONSECONFERENCE"
replace wpcode2 = "" if wpcode2 == "Q02" & regexm(wpname, "AMIS DE LA PRES.*INTEGR.*MAR")
	
	
* Working Party on Aviation
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(AVIAT)|(AER)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "Q03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(AVIAT)|(AER)")
*groups wpname if wpcode == "Q03", order(h) miss

*groups wpname if wpcode != "Q03" & wpcode != "Z00" /*
	*/ & regex(wpname, "(AVIAT)|(AER)") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "Q03" if wpcode != "Q03" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "(AVIAT)|(AER)")
*groups wpname if wpcode2 == "Q03", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "Q03" & wpcode2 != "Q03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(AVIAT)|(AER)") /*
	*/ , order(h) show(freq Freq)
replace wpcode3 = "Q03" if wpcode != "Q03" & wpcode2 != "Q03" & wpcode != "Z00" & wpcode3 == "" /*
	*/ & regexm(wpname, "(AVIAT)|(AER)")
*groups wpname if wpcode3 == "Q03", order(h) miss show(freq Freq)	

* Make correction
replace wpcode = "" if regexm(wpname, "ENVIRONNEMENT \(AVIATION\)")


* Transport attaches and meetings without specification of type of transport
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TRANSPORT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "Q05" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TRANSPORT")
*groups wpname if wpcode == "Q05", order(h) miss
	
*groups wpname if wpcode != "Q05" & regexm(wpcode, "Q0") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "TRANSPORT") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "Q05" if wpcode != "Q05" & regexm(wpcode, "Q0") == 0 & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "TRANSPORT")
*groups wpname if wpcode2 == "Q05", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "Q05" & wpcode2 != "Q05" & regexm(wpcode, "Q0") == 0 /*
	*/ & regexm(wpcode2, "Q0") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "TRANSPORT") /*
	*/ , order(h) show(freq Freq)
replace wpcode3 = "Q03" if wpcode != "Q05" & wpcode2 != "Q05" & regexm(wpcode, "Q0") == 0 /*
	*/ & regexm(wpcode2, "Q0") == 0 & wpcode != "Z00" & wpcode3 == "" /*
	*/ & regexm(wpname, "TRANSPORT")
**groups wpname if wpcode3 == "Q05", order(h) miss show(freq Freq)	

replace wpcode = "Q01" if wpname == "GROUPE TRANSPORTS TER"
replace wpcode = "Q01" if wpname == "GROUPE TRANSPORTS (TER)"
replace wpcode = "Q01" if wpname == "TRANSPORTS TER"
replace wpcode = "Q03" if wpname == "TRANSPORTS AVI"
replace wpcode = "Q04" if wpname == "RESEAU TRANSEUROPEEN DE TRANSPORT"	
replace wpcode2 = "" if wpname == "H.N. AGRI VETERINAIRES (TRANSPORT ANIMAUX)"	
replace wpcode = "Q05" if wpname == "COMITE SPECIAL GALILEO"	


* Environment
*************

	
* High Level Working Party on Environment and Development
* GROUPE DE HAUT NIVEAU ENVIRONNEMENT ET DEVELOPPEMENT
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((H\.N)|(HAUT)).*ENVI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "R05" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "((H\.N)|(HAUT)).*ENVI")
*groups wpname if wpcode == "R05", order(h) miss

*groups wpname if wpcode != "R05" & wpcode != "Z00" /*
	*/ & regexm(wpname, "((H\.N)|(HAUT)).*ENVI") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "R05" if wpcode != "R05" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "((H\.N)|(HAUT)).*ENVI")
*groups wpname if wpcode2 == "R05", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "R05" & wpcode2 != "R05" & wpcode != "Z00" /*
	*/ & regexm(wpname, "((H\.N)|(HAUT)).*ENVI") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on International Environment Issues: Global Environmental Aspects of Sustainable Development
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENVI.*INT.*DEVEL") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "R06a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENVI.*INT.*DEVEL")
*groups wpname if wpcode == "R06a", order(h) miss

**groups wpname if wpcode != "R06a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ENVI.*INT.*DEVEL") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on  International Environment Issues: Climate Change
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENV.*INT.*CLIMAT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "R06b" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENV.*INT.*CLIMAT")
*groups wpname if wpcode == "R06b", order(h) miss

**groups wpname if wpcode != "R06b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "ENV.*INT.*CLIMAT") /*
	*/ , order(h) show(freq Freq)

* Make corrections
replace wpcode = "R06b" if wpname == "ENVIRONNEMENT INTERNATIONAL (CHANGEMENT CLIM.)"
replace wpcode = "R06b" if wpname == "ENVIRONNEMENT INTERNATIONAL - CLIMA"

	
* Working Party on International Environment Issues
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENVI.*((INT)|(OCDE))") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "R06" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENVI.*((INT)|(OCDE))")
*groups wpname if wpcode == "R06", order(h) miss
	
*groups wpname if wpcode != "R06" & regexm(wpcode, "R06") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "ENVI.*((INT)|(OCDE))") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "R06" if wpcode != "R06" & regexm(wpcode, "R06") == 0 & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "ENVI.*((INT)|(OCDE))")
*groups wpname if wpcode2 == "R06", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "R06" & regexm(wpcode, "R06") == 0 /*
	*/ & wpcode2 != "R06" & regexm(wpcode2, "R06") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "ENVI.*((INT)|(OCDE))") /*
	*/ , order(h) show(freq Freq)

*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OCDE.*ENVI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "R06" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "OCDE.*ENVI")
*groups wpname if wpcode == "R06", order(h) miss
	
groups wpname if wpcode != "R06" & regexm(wpcode, "R06") == 0  /*
	*/ & wpcode2 != "R06" & regexm(wpcode2, "R06") == 0 /*
	*/ & wpcode != "Z00" /*
	*/ & regex(wpname, "(INT. ENV)|(ENVI.* INT)") /*
	*/ , order(h) show(freq Freq)
replace wpcode3 = "R06" if wpcode != "R06" & regexm(wpcode, "R06") == 0 /*
	*/ & wpcode2 != "R06" & regexm(wpcode2, "R06") == 0 /*
	*/ & wpcode != "Z00" /*
	*/ & regex(wpname, "(INT. ENV)|(ENVI.* INT)")
	
* Working Party on the Environment: Internal Environmental Aspects of Sustainable Development
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENVI.*DEV") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "R01a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENVI.*DEV")
*groups wpname if wpcode == "R01a", order(h) miss

**groups wpname if wpcode != "R01a" & regexm(wpcode, "R0[56]") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "ENVI.*DEV") /*
	*/ , order(h) show(freq Freq)

replace wpcode2 = "R01a" if wpname == "CONJOINT H.N. ENVIR. / DEVEL. ET ENVIRONNEMENT"	
	
	
* Working Party on Climate Change
* Changes title from Ad hoc WP on Climate to WP on Climate Change in 2000
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CLIM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "R02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CLIM")
*groups wpname if wpcode == "R02", order(h) miss

**groups wpname if wpcode != "R02" & wpcode != "R06b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CLIM") /*
	*/ , order(h) show(freq Freq)
	
* Make correction
replace wpcode2 = "R02" if wpcode2 == "" & wpname == "CONJOINT FORETS / BIODIVERSITE / CHANGEM. CLIMAT"
	
	
* Working Party on Biodiversity: Biosafety
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(BIOSECURITE)|(BIOSAFETY)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "R03a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(BIOSECURITE)|(BIOSAFETY)")
*groups wpname if wpcode == "R03a", order(h) miss

**groups wpname if wpcode != "R03a" & wpcode != "R06" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(BIOSECURITE)|(BIOSAFETY)") /*
	*/ , order(h) show(freq Freq)
	
	
* Working Party on Biodiversity
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BIO.*DIV") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "R03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "BIO.*DIV")
*groups wpname if wpcode == "R03", order(h) miss

*groups wpname if wpcode != "R03" & wpcode != "R06" & wpcode != "Z00" /*
	*/ & regexm(wpname, "BIO.*DIV") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "R03" if regexm(wpcode, "R03") == 0 & regexm(wpcode, "R06") == 0 /*
	*/ & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "BIO.*DIV")
*groups wpname if wpcode2 == "R03", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "R03" & wpcode2 != "R03" & wpcode != "R06" & wpcode2 != "R06" & wpcode != "Z00" /*
	*/ & regexm(wpname, "BIO.*DIV") /*
	*/ , order(h) show(freq Freq)
replace wpcode3 = "R03" if regexm(wpcode, "R03") == 0 & regexm(wpcode2, "R03") == 0 /*
	*/ & regexm(wpcode, "R06") == 0 & regexm(wpcode2, "R06") == 0 & wpcode != "Z00" & wpcode3 == "" /*
	*/ & regexm(wpname, "BIO.*DIV")
*groups wpname if wpcode3 == "R03", order(h) miss show(freq Freq)	

	
* Working Party on Persistent Organic Pollutants
* POLLUANTS ORGANIQUES PERSISTANTS
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(POP)|(POLLUANT)") /*
	*/ & regex(wpname, "POPULATION") == 0 /*
	*/ , order(h) show(freq Freq)
replace wpcode = "R04" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(POP)|(POLLUANT)") /*
	*/ & regex(wpname, "POPULATION") == 0
*groups wpname if wpcode == "R04", order(h) miss

**groups wpname if wpcode != "R04" & wpcode != "Z00" /*
	*/ & regex(wpname, "(POP)|(POLLUANT)") /*
	*/ & regex(wpname, "POPULATION") == 0 /*
	*/ , order(h) show(freq Freq)
	

* Working Party on the Environment
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENVI") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "R01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "ENVI")
*groups wpname if wpcode == "R01", order(h) miss

*groups wpname if wpcode != "R01" & regexm(wpcode, "R0") == 0 & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "ENVI") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "R01" if wpcode != "R01" & regexm(wpcode, "R0") == 0 & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "ENVI")
*groups wpname if wpcode2 == "R01", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "R01" & regexm(wpcode, "R0") == 0 & wpcode2 != "R01" /*
	*/& regexm(wpcode2, "R0") == 0 & wpcode != "Z00" /*
	*/ & regexm(wpname, "ENVI") /*
	*/ , order(h) show(freq Freq)

* Make corrections
replace wpcode = "R06" if wpname == "PARIS : COORDINATION ENVIRONNEMENT"
replace wpcode2 = "" if wpname == "AD HOC EURO - MED (ENVIRONNEMENT)"
replace wpcode2 = "R06" if wpname == "PARIS OCDE - COORDINATION AGRI / ENVIRON."
replace wpcode2 = "" if wpname == "STRUCTURES AGRI (AGRI ET ENVIRONNEMENT)"


* Health and Consumer Policy
****************************

* Working Party on Public Health
* SANTE PUBLIQUE - before 2000, there is only a 'SANTE' group
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SANTE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "S01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SANTE")
*groups wpname if wpcode == "S01", order(h) miss

**groups wpname if wpcode != "S01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SANTE") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "S01" if wpcode != "S01" & regexm(wpcode, "H23") == 0 /*
	*/ & wpcode != "H32a" & wpcode != "H32b" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "SANTE")

	
* Working Party on Consumer Protection and Information
* PROTECTION ET INFORMATION DES CONSOMMATEURS
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CONSOM") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "S02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CONSOM")
*groups wpname if wpcode == "S02", order(h) miss

*groups wpname if wpcode != "S02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CONSOM") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "S02" if wpcode != "S02" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "CONSOM")
*groups wpname if wpcode2 == "S02", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "S02" & wpcode2 != "S02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CONSOM") /*
	*/ , order(h) show(freq Freq)

	* Make corrections
replace wpcode2 = "" if wpname == "CONSEILLERS DENREES ALIMENTAIRES (CONSOMMATEURS)"
	

* Education, Youth, and Culture
*******************************

* Audiovisual Working Party
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AUDIOVISU[EA]L") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "T01" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AUDIOVISU[EA]L")
*groups wpname if wpcode == "T01", order(h) miss

**groups wpname if wpcode != "T01" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AUDIOVISU[EA]L") /*
	*/ , order(h) show(freq Freq)

	
* Education Committee
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EDUCATION") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "T02" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "EDUCATION")
*groups wpname if wpcode == "T02", order(h) miss

*groups wpname if wpcode != "T02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CONJOINT.*EDUCATION") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "T02" if wpcode != "T02" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "CONJOINT.*EDUCATION")
*groups wpname if wpcode2 == "T02", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "T02" & wpcode2 != "T02" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CONJOINT.*EDUCATION") /*
	*/ , order(h) show(freq Freq)

	
* Committee on Cultural Affairs
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CULTUREL") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "T03" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "CULTUREL")
*groups wpname if wpcode == "T03", order(h) miss

*groups wpname if wpcode != "T03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CULTUREL") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "T03" if wpcode != "T03" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "CULTUREL")
*groups wpname if wpcode2 == "T03", order(h) miss show(freq Freq)	

**groups wpname if wpcode != "T03" & wpcode2 != "T03" & wpcode != "Z00" /*
	*/ & regexm(wpname, "CULTUREL") /*
	*/ , order(h) show(freq Freq)

replace wpcode2 = "T03" if wpname == "CONJOINT GROUPE AUDIOVISUEL / CAC"

	
* Working Party on Youth: Ad hoc Daphne
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DAPHNE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "T04a" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "DAPHNE")
*groups wpname if wpcode == "T04a", order(h) miss

**groups wpname if wpcode != "T04a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "DAPHNE") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Youth: Ad hoc Combating Child Sex Tourism
* AD HOC LUTTE CONTRE LE TOURISME SEXUEL IMPLIQUANT DES ENFANTS
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "(SEX)|(ENFANTS)") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "T04b" if wpcode == "" /*
	*/ & regexm(wpname, "(SEX)|(ENFANTS)")
*groups wpname if wpcode == "T04b", order(h) miss
	
*groups wpname if wpcode != "T04b" & wpcode != "Z00" /*
	*/ & regexm(wpname, "(SEX)|(ENFANTS)") /*
	*/ , order(h) show(freq Freq)
* No observatiosn

	
* Working Party on Youth
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "JEUNESSE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "T04" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "JEUNESSE")
*groups wpname if wpcode == "T04", order(h) miss

*groups wpname if wpcode != "T04" & wpcode != "T04a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "JEUNESSE") /*
	*/ , order(h) show(freq Freq)
replace wpcode2 = "T04" if wpcode != "T04" & wpcode != "T04a" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "JEUNESSE")
*groups wpname if wpcode2 == "T04", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "T04" & wpcode != "T04a" & wpcode2 != "T04" /*
	*/ & wpcode2 != "T04a" & wpcode != "Z00" /*
	*/ & regexm(wpname, "JEUNESSE") /*
	*/ , order(h) show(freq Freq)

	
* Working Party on Sport
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SPORT") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "T05" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SPORT")
*groups wpname if wpcode == "T05", order(h) miss

**groups wpname if wpcode != "T05" & wpcode != "Z00" /*
	*/ & regexm(wpname, "( SPORT)|(^SPORT)") /*
	*/ , order(h) show(freq Freq)

	
* Remaining pre-1999 working parties (probably)
***********************************************

* Horizontal Data Systems(?)
* HORIZONTAL INFORMATIQUE
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HORIZONTAL INFORMATIQUE")
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HORIZONTAL INFORMATIQUE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "B00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "HORIZONTAL INFORMATIQUE")
*groups wpname if wpcode == "B00", order(h) miss

**groups wpname if wpcode != "B00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "HORIZONTAL INFORMATIQUE") /*
	*/ , order(h) show(freq Freq)	
* 7 observations	


* Drafting quality(?)
* GROUPE QUALITE REDACTIONNELLE
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GROUPE QUALITE REDACTIONNELLE")
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GROUPE QUALITE REDACTIONNELLE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "B00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "GROUPE QUALITE REDACTIONNELLE")
*groups wpname if wpcode == "B00", order(h) miss

**groups wpname if wpcode != "B00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "GROUPE QUALITE REDACTIONNELLE") /*
	*/ , order(h) show(freq Freq)	
* 9 observations	


* Development conference preparation
* AD HOC CNUCED IX
* Predecessor of D03
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AD HOC CNUCED IX")
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AD HOC CNUCED IX") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "D00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AD HOC CNUCED IX")
*groups wpname if wpcode == "D00", order(h) miss

**groups wpname if wpcode != "D00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AD HOC CNUCED IX") /*
	*/ , order(h) show(freq Freq)	
* 4 observations	


* Car emissions
* POLLUTION AUTOMOBILE
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "POLLUTION AUTOMOBILE")
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "POLLUTION AUTOMOBILE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "R00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "POLLUTION AUTOMOBILE")
*groups wpname if wpcode == "R00", order(h) miss

**groups wpname if wpcode != "R00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "POLLUTION AUTOMOBILE") /*
	*/ , order(h) show(freq Freq)	
* 8 observations	


* BSE crisis
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VIANDE BOVINE")
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VIANDE BOVINE") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "VIANDE BOVINE")
*groups wpname if wpcode == "H00", order(h) miss

*groups wpname if wpcode != "H00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "VIANDE BOVINE") /*
	*/ , order(h) show(freq Freq)	
* 3 observations	


* Plant protection services
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROT.*VEG")
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROT.*VEG") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "H00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROT.*VEG")
*groups wpname if wpcode == "H00", order(h) miss

*groups wpname if wpcode != "H00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PROT.*VEG") /*
	*/ , order(h) show(freq Freq)	
* 10 observations	


* Ad hoc group on Article 8.C (not clear what this is about, but one is PESC)
*list date wpname if wpcode != "Z00" /*
	*/ & regex(wpname, "8\.C")
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "8\.C") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "C00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "8\.C")
*groups wpname if wpcode == "C00", order(h) miss

*groups wpname if wpcode != "C00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "8\.C") /*
	*/ , order(h) show(freq Freq)	
* 6 observations	


* Ad hoc group on Population and Development
*list date wpname if wpcode != "Z00" /*
	*/ & regex(wpname, "POPULATION")
*groups wpname if wpcode != "Z00" /*
	*/ & regex(wpname, "POPULATION") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "D00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "POPULATION")
*groups wpname if wpcode == "D00", order(h) miss

*groups wpname if wpcode != "D00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "POPULATION") /*
	*/ , order(h) show(freq Freq)	
* 3 observations	


* Ad hoc group on CO2 Taxation
list date wpname if wpcode != "Z00" /*
	*/ & regex(wpname, "TAXE CO2")
*groups wpname if wpcode != "Z00" /*
	*/ & regex(wpname, "TAXE CO2") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "TAXE CO2")
*groups wpname if wpcode == "F00", order(h) miss
* 2 observations	

*groups wpname if wpcode != "F00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "TAXE CO2") /*
	*/ , order(h) show(freq Freq)	
*replace wpcode2 = "F00" if wpcode != "F00" & wpcode != "Z00" & wpcode2 == "" /*
	*/ & regexm(wpname, "TAXE CO2")
*groups wpname if wpcode2 == "F00", order(h) miss show(freq Freq)	

*groups wpname if wpcode != "F00" & wpcode2 != "F00" /*
	*/ & wpcode2 != "F00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "TAXE CO2") /*
	*/ , order(h) show(freq Freq)
* 6 observations


* Industrial property (part of intellectual property)
list date wpname if wpcode != "Z00" /*
	*/ & regex(wpname, "PROP.*IND")
*groups wpname if wpcode != "Z00" /*
	*/ & regex(wpname, "PROP.*IND") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "K00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "PROP.*IND")
*groups wpname if wpcode == "K00", order(h) miss

*groups wpname if wpcode != "K00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "PROP.*IND") /*
	*/ , order(h) show(freq Freq)	
* 2 observations	


* Ad hoc group on Electronic Commerce
list date wpname if wpcode != "Z00" /*
	*/ & regex(wpname, "COMM.*ELEC")
*groups wpname if wpcode != "L00" /*
	*/ & regex(wpname, "COMM.*ELEC") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "L00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "COMM.*ELEC")
*groups wpname if wpcode == "L00", order(h) miss

*groups wpname if wpcode != "L00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "COMM.*ELEC") /*
	*/ , order(h) show(freq Freq)	
* 3 observations	


* Ad hoc group on Payment Systems
*list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SYS.*PAY")
*groups wpname if wpcode != "F00" /*
	*/ & regex(wpname, "SYS.*PAY") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "F00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "SYS.*PAY")
*groups wpname if wpcode == "F00", order(h) miss

*groups wpname if wpcode != "F00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "SYS.*PAY") /*
	*/ , order(h) show(freq Freq)	
* 5 observations	


* Police (Technique and Science)
list date wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "POLICE SCIENT.*TECH")
*groups wpname if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "POLICE SCIENT.*TECH") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "G00" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "POLICE SCIENT.*TECH")
*groups wpname if wpcode == "G00", order(h) miss

*groups wpname if wpcode != "G00" & wpcode != "Z00" /*
	*/ & regexm(wpname, "POLICE SCIENT.*TECH") /*
	*/ , order(h) show(freq Freq)	
* 5 observations	


* Friends of the Presidency Group
* This group deals with different issues and, depending on that, 
* may be composed of different members. When the formation can be attributed to a
* certain working party, it's coded accordingly be leaving the coding to the end of the 
* do-file
*groups wpname if wpcode == "" &  wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS.*PRES") /*
	*/ , order(h) show(freq Freq)
replace wpcode = "A10" if wpcode == "" & wpcode != "Z00" /*
	*/ & regex(wpname, "AMIS.*PRES")
*groups wpname if wpcode == "A10", order(h) miss

*groups wpname if wpcode != "A10" & wpcode != "Z00" /*
	*/ & regexm(wpname, "AMIS.*PRES") /*
	*/ , order(h) show(freq Freq)	
* 5 observations	

* Assign Friends of the Presidency meetings to substantive working party if possible
replace wpcode = "C04" if wpname == "BALKANS OCCIDENTAUX - AMIS DE LA PRESIDENCE"
replace wpcode = "G00" if wpname == "AMIS DE LA PRESIDENCE (JUSTICE)"
replace wpcode = "B10" if wpname == "AMIS DE LA PRESIDENCE (COUR DE JUSTICE)"
replace wpcode = "B10" if wpname == "AMIS DE LA PRESIDENCE - COUR DE JUSTICE"
replace wpcode = "B10" if wpname == "AMIS DE LA PRESIDENCE (COUR JUSTICE)"
replace wpcode = "H00" if wpname == "AMIS DE LA PRESIDENCE - GRIPPE AVIAIRE"
replace wpcode = "H00" if wpname == "AMIS DE LA PRESIDENCE (GRIPPE AVIAIRE)"
replace wpcode = "B00" if wpname == "AMIS DE LA PRESIDENCE - PRUM"
replace wpcode = "F00" if wpname == "AMIS DE LA PRESIDENCE (FINANCE)"
replace wpcode = "G01" if wpname == "AMIS DE LA PRESIDENCE (IMMIGRATION / ASILE)"
replace wpcode = "G01" if wpname == "AMIS DE LA PRESIDENCE (IMMIG.)"
replace wpcode = "G18" if regexm(wpname, "INVESTIGATION ORDER")
replace wpcode = "K04" if wpname == "AMIS DE LA PRESIDENCE (PROP. INT.)"
replace wpcode = "B08" if wpname == "AMIS DE LA PRESIDENCE (Simpl. - Codif.)"

* Check coding post-1999
groups wpname if wpcode == "" & date >= d(01jul1999), order(h) show(f F P)

replace wpcode = "C00" if wpname == "EXPERTS MILITAIRES"
replace wpcode = "C00" if wpname == "EXPERTS MILITAIRE OMI UE + 15"
replace wpcode = "C39" if wpname == "OTAN: EUMC + CM OTAN"
replace wpcode = "C39" if wpname == "OTAN: EUMC + NATO MC"
replace wpcode = "G00" if wpname == "AD HOC PROCEDURAL RIGHTS"
replace wpcode = "A06" if wpname == "CATS (CTE MIXTE)"
replace wpcode = "C08" if wpname == "COAFR / USA"
replace wpcode = "C09" if wpname == "COASI - CODIA AVEC DPRK"
replace wpcode = "K03" if wpname == "MARCHE INTERIEUR - STATISTIQUES"
replace wpcode = "F07b" if wpname == "GROUPE FISCALITE (DIRECTE)"
replace wpcode = "D03" if wpname == "PREF. CONF. INTERN. DEVELOPPEMENT (DESERTIFICATION)"
replace wpcode = "G00" if wpname == "CONSEILLERS JURIDIQUE DES REPS. PERMANENTS"
replace wpcode = "G00" if wpname == "CONSEILLERS JURIDIQUE"
replace wpcode = "A12" if wpname == "COMITE DE SECURITE - PREP. NORWAY"
replace wpcode = "K00" if wpname == "QUESTIONS ECO. - UNITES DE MESURE"
replace wpcode = "R01" if wpname == "ENV. - PAYS CANDIDATS"
replace wpcode = "R01" if wpname == "ENV. - PAYS CANDIDATS"

* Check coding post-2010
groups wpname if wpcode == "" & date >= d(01jan2011), order(h) show(f F P)
* Make corrections
replace wpcode = "A12" if wpname == "COMITE DE SECURITE (SPACE SITUATIONAL AWARENESS EXPERTS)"
replace wpcode = "A12" if wpname == "CSC - SSA"
replace wpcode = "A12a" if wpname == "COMITE DE SECURITE - CSCI"
replace wpcode = "A12a" if wpname == "COMITE DE SECURITE - CSC (IA)"
replace wpcode = "A12c" if wpname == "C - SAP"
replace wpcode = "G38" if wpname == "FRIENDS OF VIS"
replace wpcode = "B12" if wpname == "QUESTIONS ATOMIQUES - EXPERTS"
replace wpcode = "B26" if wpname == "e- JUSTICE (e - LAW)"
* Not clear what MSB stands for

* Check coding pre-1999
groups wpname if wpcode == "" & date < d(01jul1999), order(h) show(f F P)

* Make corrections
replace wpcode = "B09" if wpname == "20.MN.47 JURISTES / LING."
replace wpcode = "B09" if wpname == "20.MN.47 JUR. / LINGUISTES"
replace wpcode = "H09" if wpname == "CULTURE ARABLE (AGENDA 2000)"
replace wpcode = "H09" if wpname == "AGENDA 2000 - CULTURE ARABLE"
replace wpcode = "F00" if wpname == "FISCALITE"
replace wpcode = "H00" if wpname == "(VETERINAIRES)"
replace wpcode = "A04" if wpname == "113 ILES FEROE"
replace wpcode = "D00" if wpname == "AD HOC UNCTAD IX"
replace wpcode = "K10" if wpname == "ATTACHES PROD. PHYTOPHARMACEUTIQUES"
replace wpcode = "A04" if wpname == "COMITE 113 PROP. INT."
replace wpcode = "G00" if wpname == "COMITE MIXTE UE - NORVEGE / ISLANDE"
replace wpcode = "R01" if wpname == "ENV."
replace wpcode = "G00" if wpname == "ENTRAIDE JUDICIAIRE"
replace wpcode2 = "G00" if wpname == "CONJOINT ENTRAIDE JUDIC. / COOPERATION DOUAN."
replace wpcode = "K07" if wpname == "ETS. ET SERVICES (MEDICINS)"
replace wpcode = "R06a" if wpname == "EXPERTS ENV / DEVELOP. OCEANS"
replace wpcode = "R06a" if wpname == "ENV / DEVELOPPEMENT EXPERTS OCEANS"
replace wpcode = "A04d" if wpname == "GENEVE: COMITE AD HOC ARTICLE 113/ SERVICES"
replace wpcode = "G23" if wpname == "GROUPE MULTIDISCIPLINAIRE"
replace wpcode = "R05" if wpname == "H.N. CONJOINT ENV. / DEVELOPPEMENT"
replace wpcode = "F00" if wpname == "H. N. FISCALITE ENTREPRISES"
replace wpcode = "K00" if wpname == "QUESTIONS ECO. - MEDECINS"
replace wpcode = "K07" if wpname == "QUESTIONS ECO. E.S. AVOCATS"
replace wpcode = "K00" if wpname == "CONSEILLERS ECONOMIQUES (ASCENSEURS)"
replace wpcode = "K00" if wpname == "CONSEILLERS ECONOMIQUES"
replace wpcode = "K00" if wpname == "RATIO SOLVABILITE"
replace wpcode = "K00" if wpname == "QUESTIONS ECO (RATIO DE SOLVABILITE)"
replace wpcode = "G00" if wpname == "RESEAU JUDICIAIRE"
replace wpcode = "F00" if wpname == "QUESTIONS ECO. NETTING"

*list wpcode wpname date if regexm(wpname, "AMIS DE LA PRESIDENCE") & wpcode == "K08j"
replace wpcode = "A10" if regexm(wpname, "AMIS DE LA PRESIDENCE") & wpcode == "K08j"
*list wpcode wpname date if wpcode == "A10e" & date < d(30mar2010)
replace wpcode = "A10" if wpcode == "A10e" & date < d(30mar2010)
*list wpcode wpname date if regexm(wpname, "DISPOSITIFS MEDICAUX") & wpcode == "C22a"
replace wpcode = "K10" if regexm(wpname, "DISPOSITIFS MEDICAUX") & wpcode == "C22a"
*list wpcode wpname date if regexm(wpname, "HARMONISATION TECHNIQUE") & wpcode == "C22a"
replace wpcode = "K08" if regexm(wpname, "HARMONISATION TECHNIQUE") & wpcode == "C22a"
*list wpcode wpname date if wpcode == "F06g" & date > d(04mar2003)
replace wpcode = "A10" if wpcode == "F06g" & date > d(04mar2003)

* Drop second working party coding for Jurist-Linguist meetings
replace wpcode2 = "" if wpcode == "B09"

* 410 observations (out of more than 70,000) remain uncoded, 
* most of them do not refer to working parties, especially post-1999

/* The policy sector of these entries could not be identified
(MSB)
COMITE RED. BULLETIN FRAUDES
AD HOC PLURILINGUISME
LIAISONS TECHNIQUES
REDEVANCE AGENCE MEDICAMENTS
HELMS - BURTON
RESEAUX TRANSEUROPEENS (could be finance or transport network)
CONSEILLERS SURV. PRUD.
QUESTIONS ECO (REDEVANCES)
CONSEILLERS ECONOMIQUES (EPI)
QUESTIONS ECO
QUESTIONS ECO. EMISSIONS SONORES
*/


* Code remaining missing values
groups wpname if wpcode == "", order(h) show(f F P)
replace wpcode = "Z99" if wpcode == ""
groups wpname if wpcode == "Z99" /*
	*/ , order(h) show(freq Freq)	

* Summarize coding
tab wpcode, m 
tab wpcode if date < d(01jul1999), m 
tab wpcode if date >= d(01jul1999), m
tab wpcode if date >= d(01jan2011), m

* Save dataset
compress
sort wpcode
des
save "Data management\wpar-management05-workingparties02-code.dta", replace

* Close log
log close
exit
